home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / More Source / C⁄C++ / Xconq 7.0d37 / doc / PROJECTS < prev    next >
Text File  |  1995-05-04  |  109KB  |  2,757 lines

  1. PROJECT IDEAS
  2.  
  3. --Overall
  4.  
  5. Be able to resign without losing all units (but what effect
  6. then? defined by game?).
  7.  
  8. --GDL
  9.  
  10. Define a global "side*" that is a list of all sides.
  11.  
  12. In evals, give meaning to "this" so expressions like (count <u> (this side))
  13. work.
  14.  
  15. Could restrict some tables to 15 bit integers, use top bit to repn varying
  16. value, up to 16d15+127 by doing a 4/4/7 split of bits.
  17.  
  18. Support full decimals for parms, flush the "10000" numbers and add scale
  19. factor to all numeric parms.  Scaling fixed by code, use scaling when
  20. computing effects.
  21. Ambiguity if context of decimal doesn't include scale factor (as in "define"),
  22. but could support decimals as a distinct type in GDL (as ratios instead of
  23. floats?).  c_number should convert to integer, or check validity of uses.
  24.  
  25. When conditionally not loading, should not intern symbols or alloc strings.
  26. (use a global to test in lisp.c - must read well enough to recognize the "end-if")
  27.  
  28. Error messages should include context as well as line numbers (save previous
  29. several lines, and dump next several if still reading after error).
  30.  
  31. --Types and Objects
  32.  
  33. When restoring a game, record which sides get which players (if recording
  34. that), and that game was restored, but do nothing further for events.
  35.  
  36. Climate-related global vars should become world or area properties.
  37.  
  38. Need a way to indicate that some types are never available in a game,
  39. cache in arrays u_available[], etc, test internally, etc.
  40. Also need a per-turn test to see what is currently available.
  41.  
  42. Notify display when cover goes to/from 0 (but excessive, since coverage
  43. always cleared then restored later).
  44.  
  45. Add a controlled-by layer to world that can be distinct from people side.
  46. Control can be imposed by presence of particular units within a given
  47. range, maintained by others to a given range, with chance of reversion
  48. to people side if different from controlling side.
  49.  
  50. Define unit->origside, indep of politics/feelings, use in reporting,
  51. liberation, etc.  Captured unit goes to origside if trusted or friendly
  52. to capturing unit's side.
  53.  
  54. Define unit feelings toward each side as pair of bytes, for/against and
  55. willingness to act on feeling.
  56.  
  57. Clarify vision rules.  The true state of the world is a set of layers.
  58. For each cell in each layer, there is an apparent value, a date for
  59. that value, possibly prev values also.  Only need bit if value always
  60. accurately known once discovered.  Elevations and features unlikely
  61. to change, but weather, units, people, material often inaccurate.
  62. directly_visible(side, unit)
  63. implies that unit is accurately seen.
  64. chance_to_see{,_on_movement,_on_action,_each_turn}(side, unit)
  65. if always 100%, then is equiv to directly_visible.
  66.  
  67. Define a unit->tracking slot that is a sidemask of sides that are
  68. seeing the unit move around.  (Unit property "trk".)
  69. #define side_tracks_unit(side,unit) (unit->tracking&side_bit(side)).
  70. Define u_track_chance, defaults to 0.
  71. Define u_lose_track_chance, evaluate once/move, once/turn.
  72. If unit being tracked, then updates about unit state go to all
  73. tracking sides.
  74. Track bit would always be set for own units.
  75.  
  76. Implement storms as very-high-density cloud (>100%?).  Storms cause
  77. accidents and attrition.
  78.  
  79. Impl constant elevations and temps that don't need a whole layer.
  80. Detect by seeing min == max of terrain types present (and no chance
  81. of terrain changes - test this in general).
  82.  
  83. Allow some moves to use random mp, be able to specify +/- amounts.
  84. This is mp (and acp?) consumption only, does not affect validity of action.
  85. ut_mp_extra?
  86.  
  87. Define a notion of hp for bord/conn types, allows for interdiction
  88. and repair.
  89.  
  90. Side library should be able to allow multiple usages of some members.
  91.  
  92. Define a hallucination chance for some utypes:
  93. (sp-)looks-like u1 u2 -> n% is chance that u1 appears to be a u2
  94. and is recorded as such in a view.
  95. Note that code should ensure that only info about image is displayed
  96. rather than hallucination.
  97.  
  98. Use a slot (which?) to indicate variation radius of actual reinforcement
  99. position around  given xy.  Default of zero requires to be on actual xy.
  100.  
  101. Implement ZOC as a layer if any ZOC ranges > 1.
  102.  
  103. Add a new layer coveralt to indicate the lowest altitude visible
  104. to any unit on the side.  Adjust along with basic coverage.
  105.  
  106. Add a "facing" bitmask that indicates the directions that a unit is
  107. "facing", or can operate in, add effects of facing vs non-facing.
  108. Come up with a display for this.
  109.  
  110. Events can have causes that they should be tied to, can use to
  111. enhance displays etc.
  112.  
  113. Allow a symbol for reference to sides.
  114. Syntax is (side <n> [<symbol>] props...).
  115.  
  116. Add a (x (symbol <sym>)) to units that can be used to write a symbolic
  117. ref to unit when saving.
  118.  
  119. Maintain an in-supply bit for units.
  120.  
  121. Add chance that incomplete units will lose cp (eliminating if cp == 1),
  122. call it incomplete-accident-chance.
  123.  
  124. To decide about control, see if any units cannot always be controlled
  125. directly, then for those compute the max radius that controlling units
  126. can be in.  If > 1, should define a layer, otherwise check directly
  127. when need to know.
  128.  
  129. Some unit types should be unwilling to break a treaty.
  130. (In some games,)
  131. Should humans have to declare war explicitly?
  132. DoW may not be possible or meaningful in some games...
  133. DoW is agreement by single player doing the declaration, terms are to
  134. treat side as enemy (doctrine), and to hit other side (how often?),
  135. could demand a surrender of some sort.
  136. DoW must be public.
  137. Up to other sides how to respond.
  138. Peace treaty includes terms to nullify DoW.
  139. In general, terms should be able to include refs to other agreements.
  140. DoW can always be rescinded by player alone, make it have morale
  141. consequences?
  142.  
  143. LOS always sees straight overhead perfectly, so calculations really
  144. figure how how low to the ground is visible at any point.
  145.  
  146. Could add a bit vector to spottable units indicating which sides
  147. are tracking.
  148.  
  149. For each unit type, add a property that indicates fate of unit when
  150. side leaves the game - change side, disappear, no change.
  151.  
  152. @deffn Table @code{people-sabotage-rate??} u m -> .01hp
  153. This table is the attrition rate of a unit in the open in
  154. a cell with people on a hostile [define] side.
  155. @end deffn
  156.  
  157. DEF_UPROP_I("lockon-chance", u_lockon_chance,
  158.     "chance that unit remains seen when no longer covered",
  159.     lockonchance, 0, 0, 100)
  160. @deffn UnitTypeProperty @code{lockon-chance} n%
  161. This property is the chance that once seen, a unit will continue to be seen
  162. while it is being covered.
  163. Defaults to @code{0}.
  164. @end deffn
  165.  
  166. DEF_UPROP_I("storage", u_storage,
  167.     "space for materials shared by all types",
  168.     storage, 0, 0, 9999)
  169. DEF_UM_TABLE("material-size-in-unit", um_size,
  170.     "how much space one unit of a material requires in a unit",
  171.     umsize, constumsize, 0, 1, 9999)
  172. @deffn UnitTypeProperty @code{storage} n
  173. This property is a unit's generic space for materials of any type.
  174. Defaults to @code{0}.
  175. @end deffn
  176. @deffn Table @code{material-size-in-unit} u m -> n
  177. This table is the amount by which the given material counts against
  178. the unit's storage space.
  179. Defaults to @code{1}.
  180. @end deffn
  181.  
  182. DEF_UT_TABLE("capacity-negation", ut_capacity_neg,
  183.     "true if the unit negates capacity of connections of the terrain type",
  184.     utcapacityneg, constutcapacityneg, 0, 0, 1)
  185. [, but some unit types negate the capacity of connections.]
  186. @deffn Table @code{capacity-negation} u t -> t/f
  187. This table is @code{true} if when @var{u} is in the open in a cell
  188. that includes connections of type @var{t},
  189. those connections have no capacity for units.
  190. Defaults to @code{false}.
  191. @end deffn
  192.  
  193. Implement (or stub) basic goal tests.
  194.  
  195. Implement doctrine locking.
  196.  
  197. Terrain types should have a precedence determining which conn/border types
  198. override each other's effects (right now any conn overrides any border).
  199. Should be a property of ttypes.
  200.  
  201. Side relations could be expressed as a bit vector of what will happen
  202. in various situations.  "wake up if approached", "allow entry", "exchange
  203. view info", etc.  Particular relationships such as trust and control
  204. become particular bit vectors then. (or could do as defcon levels?)
  205.  
  206. Need a way to have an OB with lots of units, followed by refs to
  207. particular units and modified properties, and read both without
  208. creating any useless units.
  209.  
  210. --Setup
  211.  
  212. In elevation setup, map raw elevations to min of range for ttype,
  213. stretch so values are even through range.
  214.  
  215. When opening a game module, add its directory to the list of directories
  216. to search for included modules.
  217.  
  218. Assign numbers to numbered units after all are read in.
  219.  
  220. Add a command-line option to interpret forms supplied on the command line.
  221. Do these after all else read and interpreted and variants done.
  222.  
  223. Each side should be able to get different instructions.
  224. Per-side instructions should not be accessible to other sides.
  225.  
  226. Should use elevation diffs to decide about sloping-type terrain.
  227. Add to basic percentile algorithm.
  228.  
  229. Add a "spur" phase to road gen that connects to nearest road.
  230.  
  231. Add a chance for roads that just cross the area from one edge to
  232. another.
  233.  
  234. If a next dir for a road has a possibility to connect to a unit
  235. of a type that roads connect to, choose the dir to that unit over
  236. any open terrain direction.
  237.  
  238. Roads should be able to run in non-closer dirs for a small number
  239. of steps.  Should also look ahead to pick overall most favorable
  240. routing.
  241.  
  242. Player mix test should be allowable_player_mix(assignmentindex),
  243. allows "scapegoating" a particular player if failed - gives
  244. a starting place for interface to fix.
  245.  
  246. Define parms for variability of initial materials using variation
  247. on fractal percentile synth method.
  248.  
  249. Change random renaming to offer a list of choices, but not to load
  250. all the emblems.
  251.  
  252. Liquid adjacent terrain types should always even out to same elevation
  253. (highest or average of all the competing elevations?)
  254. Flooding is always instantaneous if ttypes changed by a unit.
  255. Non-liquid border might or might not be a dike.
  256.  
  257. Add density of occupants of indep units already placed.  Specify for
  258. both units that have to be occs and others that don't.
  259.  
  260. Need a way to coordinate all name gen for a single side -
  261. "foo" -> Fooland, Fooard, Fooards, Fooish"  Could also decide colors and
  262. emblem randomly, but wouldn't need to coordinate.
  263. Specify just *one* side name generator, extensions added in a standard
  264. way by an nlang.c routine.
  265. Predefine nonterminals side-name, side-noun, etc in side-namer grammar.
  266.  
  267. Add "earthlike" generator that borrows code, but is completely wired
  268. to do Earthlike stuff, including a semi-wired set of terrain types
  269. (use extensions to recognize by attributes rather than position,
  270. so that river deltas can be flat and swampy indep of how terrain type
  271. fits with others in a game design).
  272. Use tectonic code at some scales, erosion at others.
  273. Could base calcs on sphere, translate to world grid when done.
  274. Base on all real dimensions, so alt ranges wired.
  275. Parameters are area size/world.circumference for the scale
  276. (assume 100 km/cell if weird circumference),
  277. latitude of area, range of elevations (0 - 10000 meters),
  278. distance from coast (at center of area, allows specifying distance such that
  279. area can be 3/4 land, etc), average temp, average rainfall.
  280. For tectonics, use layers for plate num, move dir, and elevation.
  281. For small-scale, make random ridge/high point, erode down to lowest
  282. or to coast.
  283.  
  284. Could add recorded events that get played when their scheduled time
  285. arrives, so that a city could revolt or disappear at a preset time.
  286. Playing scheduled events should happen after acp/mp calc, but before
  287. players actually get to move.
  288.  
  289. Kernel should be able to do a system reset - all data structures
  290. and all allocation, so that a different game can be started up.
  291.  
  292. Add synth method for secret scorekeeper goals.
  293.  
  294. Use password to match up players when restoring into a different set
  295. of displays.  If no password, then will just accept a different
  296. assignment, perhaps warn for cmdline setup, flag in dialog boxes.
  297.  
  298. Any terrain-based variation, such as temperature, should check
  299. if need to represent varying values over area, don't need to
  300. alloc layer if not, *but* may need to quickly synth layer if
  301. terrain is added that *does* allow variations.
  302.  
  303. Should be able to conceal the identity of side until first
  304. encountered (still display progress in turn, helpful to play).
  305.  
  306. In percentile terrain, map raw to final elevation more smoothly,
  307. computing min/max raw and final, stretching raw range to cover
  308. final range uniformly.
  309.  
  310. When making units appear, do only units in open directly, then
  311. occupants recursively once transports have appeared.
  312. Similarly for disappearance, but in reverse order.
  313.  
  314. Add this?  What is it supposed to mean?
  315. DEF_UU_TABLE("can-command", uu_can_command,
  316.     "true if the type can give orders to the other type",
  317.     uucancommand, constcancommand, 0, 0, 1)
  318.  
  319. --Actions
  320.  
  321. Unit action priority should be able to derive from individual extension
  322. property, a per-side vector of type priorities, a per-type property,
  323. and a per-side property.  Routine is just unit_priority(unit).
  324. Goal is to be able to have, say, allied aircraft and German ground
  325. units move together, then German aircraft and allied ground, then
  326. trains and trucks of both sides.
  327.  
  328. Define action "influence" that is like proposed "charm" but more
  329. general.
  330.  
  331. Side changing should not be a type of action.
  332.  
  333. Allow free disbanding of incomplete units.
  334.  
  335. Allow the construction of bases even when it would be necessary
  336. to bring all units stacked in the cell inside the incomplete base,
  337. in order to make sufficient room.
  338. Entries should be automatic and free.
  339.  
  340. Add a uu_acp_for_pursuit to give a bonus if the victim is retreating.
  341.  
  342. Implement acp_for_retreat.  For each direction away from the attacker,
  343. see if (acp_for_retreat + acp) * speed > mp needed to enter cell.
  344. Do for each dir, pick workable.  But first try to retreat into transports
  345. if possible.
  346.  
  347. Changing type should have a material cost, so peon can buy title.
  348. Extend to material prerequisite cost for all actions? (lots of tables!)
  349.  
  350. Add a separate chance for defender to capture attacker upon counterattack.
  351.  
  352. Add a material cost um_material_per_<type> and prerequisite
  353. um_material_to_<xxx> for all actions.
  354.  
  355. Generalized notion of fire interdiction would be useful, could subsume
  356. effects of jammers and suchlike, also if firing is used to represent
  357. aircraft raids, need a way to define interceptors that can reduce
  358. the effectiveness of the raid and the amount of aircraft material
  359. available.
  360.  
  361. To do < 1 cell/turn speeds, available acp should translate to
  362. occasional ability to move.
  363.  
  364. Some types of combat should not be able to reduce victim hp below a given
  365. level.  uu_min_hp_from_hit.
  366.  
  367. Define material-theft-per-contact(u1, u2, r) -> n in combat,
  368. material-loss-per-hit(u1, u2, r) -> n which is material completely lost.
  369. Some could be "resorbed" by terrain?
  370.  
  371. Some occ types could protect by intensifying counterattack.
  372.  
  373. Chance to surrender should be higher if damaged.
  374.  
  375. A mobile unit should be considered surrounded or cornered if adjacent
  376. cells are either impassable or occupied by unfriendlies.  Also look for
  377. impassable borders and passable connections.
  378.  
  379. Occupants of captured units might get to stay and not change side
  380. if friendliness-to-enter allows it (?).
  381.  
  382. Detonation's effects should depend on altitude of detonating unit -
  383. compute the "actual" 3d distance.
  384.  
  385. Define effects of altitude differences on all unit interactions.
  386.  
  387. Damage to multi-part units could be done by detaching wrecked-type
  388. instead of damaging all parts equally.  Do only if wrecked-type
  389. has appropriate sizes.  Only applies if wrecked-type has equal num
  390. parts to original type.
  391.  
  392. Could do multi-cell move actions as repn of hex entry until
  393. anything happens that requires a decision - blockage, etc.
  394. example: acp = 1, mp/acp = 10, allows single move of up to 10 hexes.
  395.  
  396. If a side wins a battle, then side's units involved should gain affinity
  397. for side, lose fear of other side.
  398. On losing side, units lose affinity for own side and increase fear of
  399. winning side.  Nonparticipants also affected, but less so.
  400. Affinity increases by positive acts, fear increases by negative acts.
  401. Betrayals should be detectable, have large effect.
  402. Need some implicit agreements about defense of units on a side,
  403. that players should not violate.
  404.  
  405. Side action limit should be a distinct value, decremented only for "manual"
  406. activity by player (first action after waiting for input?).
  407.  
  408. Add a "coordination" action that adds other units to a unit's attack,
  409. with multiplied effect.  Attack action has to look at each coordinating
  410. unit, add effect if able to do so, and take away acp for coordinating
  411. units also.
  412.  
  413. For variable-commitment combat, attacker effectively sets m% commitment
  414. for self, desires n% from defender.  Defender then chooses between n1-n2%
  415. commitment, where limits set by unit types and m%.
  416. Possible reactions also limited by commitment - defender could disengage
  417. at <10% commitment, say, is otherwise stuck in the battle.
  418. Reactions are counterattack, surrender, withdraw, do nothing special,
  419. these are (mostly) indep of damage.
  420.  
  421. Commitments default to zero.  If can be nonzero, create battle objects.
  422.  
  423. If defender counterattacks, then might exchange attacker/defender
  424. in battle, so now defender can decide commit/withdraw.
  425.  
  426. Response to capture attempt might be to hit capturing unit?
  427. Capture after combat is really a side effect where a unit surrenders
  428. (implies attacking unit might end up doing the surrendering!).
  429.  
  430. Add loss of material as consequence of combat.
  431. @deffn Table @code{theft-chance-per-attack??} u1 u2 -> n%
  432. @end deffn
  433. @deffn Table @code{stealable-material??} u m -> n
  434. @end deffn
  435. @deffn Table @code{loss-per-attack??} u1 u2 -> n%
  436. @end deffn
  437.  
  438. Add variable commitment and then constrain it:
  439. @deffn Table @code{attack-commit-min??} u1 u2 -> n%
  440. @end deffn
  441. @deffn Table @code{defend-commit-min??} u1 u2 -> n%
  442. These tables are the minimum limits on the initial commitment to a battle.
  443. Defaults to @code{0}.
  444. @end deffn
  445.  
  446. @deffn Table @code{attack-commit-max??} u1 u2 -> n%
  447. @end deffn
  448. @deffn Table @code{defend-commit-max??} u1 u2 -> n%
  449. These tables are the maximum limits on the initial commitment to a battle.
  450. Defaults to @code{100}.
  451. @end deffn
  452.  
  453. @deffn Table @code{attack-commit-up-max??} u1 u2 -> n%
  454. @end deffn
  455. @deffn Table @code{defend-commit-up-max??} u1 u2 -> n%
  456. @end deffn
  457. @deffn Table @code{attack-commit-down-max??} u1 u2 -> n%
  458. @end deffn
  459. @deffn Table @code{defend-commit-down-max??} u1 u2 -> n%
  460. These tables are the maximum limits on the change to commitment to a battle.
  461. Defaults to @code{100}.
  462. @end deffn
  463.  
  464. cxp affects both attack and defense abilities, should define
  465. uu_cxp_{attack,defend}_effect.
  466.  
  467. Be able to control whether occupants can be attacked directly.
  468.  
  469. [need general defns for who moves and when during combat rounds]
  470. [could potentiall acquire additional acp if move is discretionary,
  471. also get a level of flexibility about future commitment]
  472.  
  473. [need combat's effect on tooling? uu_tp_hit_effect, can be positive
  474. or negative (being hit helps recruiit soldiers)
  475. just hit tp randomly as percentage of hp]
  476.  
  477. @c @deffn Table @code{cxp-hit-plus-max} u1 u2 -> n%
  478. @c This table is the maximum hit modifier for attacker unit.
  479. @c Defaults to @code{0}.
  480. @c @end deffn
  481. @c 
  482. @c @deffn Table @code{cxp-hit-minus-max} u1 u2 -> n%
  483. @c This table is the maximum hit modifier for defender unit.
  484. @c Defaults to @code{0}.
  485. @c The actual hit probability equals the basic hit probability, plus
  486. @c @code{experience-hit-plus-max} times fractional experience (i.e.
  487. @c experience divided by maximum experience) of the attacking unit, minus 
  488. @c @code{experience-hit-minus-max} times fractional experience of the
  489. @c defending unit.
  490. @c @end deffn
  491.  
  492. DEF_VAR_I("actions-are-buffered", g_actions_buffered, set_g_actions_buffered,
  493.     "",
  494.     gactionsbuffered, 0, 0, 1)
  495.  
  496. @deffn GlobalVariable @code{actions-are-buffered} t/f
  497. This variable is @code{true} if all the units of the same priority
  498. must specify their actions first and then execute
  499. them all at once,
  500. rather than deciding and executing before the next unit gets to act.
  501. Defaults to @code{false}.
  502. @end deffn
  503.  
  504. DEF_UU_TABLE("material-cxp-effect", uu_material_cxp_effect,
  505.     "effect of combat experience on material usage in combat",
  506.     uumaterialcxp, constuumaterialcxp, 0, 100, 9999)
  507. @deffn Table @code{material-cxp-effect} u1 u2 -> n
  508. @end deffn
  509.  
  510. DEF_UU_TABLE("attack-elevation-effect", uu_attack_elev_effect,
  511.     "",
  512.     uuattackeleveff, constuuattackeleveff, 0, 100, 9999)
  513. @deffn Table @code{attack-elevation-effect} n
  514. Defaults to @code{100}.
  515. @end deffn
  516.  
  517. DEF_UU_TABLE("friendly-hit-chance", uu_friend_hit,
  518.     "base chance for a type of unit to hit a unit on a friendly side",
  519.     uufriendhit, constuufriendhit, 0, 0, 100)
  520. @deffn Table @code{friendly-hit-chance} u1 u2 -> n%
  521. This table is the chance that a unit @var{u2} on the attacker's side will
  522. be hit accidentally during an @code{overrun} or @code{fire-into}
  523. action.
  524. Defaults to @code{0}.
  525. @end deffn
  526.  
  527. DEF_UU_TABLE("ambush-chance", uu_ambush,
  528.     "chance that a unit will be able to attack by surprise",
  529.     uuambush, constuuambush, 0, 0, 100)
  530. @deffn Table @code{ambush-chance} u1 u2 -> n%
  531. If @var{u1} attempts to move into a cell containing @var{u2},
  532. then a) if can't co-occupy, this table is the chance that @var{u1}
  533. gets a chance to attack at improved odds(?), or if b) if can
  534. co-occupy, then @var{u1} will enter the cell, then be attacked
  535. as in a).  The ambusher's plan can flag whether the unit
  536. will take ambush opportunities or not.
  537. @end deffn
  538.  
  539. DEF_UT_TABLE("mp-to-ascend", ut_mp_to_ascend,
  540.     "mp needed to increase elevation or altitude",
  541.     utmptoascend, constutmptoascend, -1, 0, 9999)
  542.  
  543. DEF_UT_TABLE("mp-to-descend", ut_mp_to_descend,
  544.     "mp needed to reduce elevation or altitude",
  545.     utmptodescend, constutmptodescend, -1, 0, 9999)
  546. @deffn Table @code{mp-to-ascend} u t -> mp
  547. @end deffn
  548. @deffn Table @code{mp-to-descend} u t -> mp
  549. These tables are the mp cost to go from the min possible elevation
  550. to the max possible elevation in the world.
  551. This is interpolated and rounded down.
  552. @var{t} is the type of terrain being left.
  553. Defaults to @code{0}.
  554. @end deffn
  555.  
  556. @deffn Table @code{ablation} u1 u2 -> n%
  557. This table is the amount of the hit that gets passed through
  558. to the transport's occupants.
  559. Defaults to @code{100}.
  560. @end deffn
  561.  
  562. @deffn Table @code{stack-ablation} u1 u2 -> n%
  563. @end deffn
  564.  
  565. --Backdrop
  566.  
  567. Run end-of-turn scorekeepers at end of turn 0 (right before first
  568. turn of game)?
  569.  
  570. Add a min-hp-to-recover that is like hp-to-repair, but applies to
  571. automatic hp recovery.
  572.  
  573. Add ut_people_supply that is amount of supply gotten by unit if people in
  574. cell are on the same side.
  575.  
  576. Express need for limited supply as "n turns of supply before starvation"?
  577. Can lead to tough decisions about starving rear areas for sake of major
  578. offensives, etc.
  579.  
  580. in-length > 0 + ability to transfer from terrain should mean that unit
  581. can get supply from cells other than own cell.  Use to get water from
  582. adjacent land in "voyages".
  583.  
  584. Should choose side to revolt to by counting
  585. number of units (of same type on each side?).
  586.  
  587. Siege surrender chance should be distinct from normal surrender chance.
  588.  
  589. Games should be able to define what size groups can be surrounded,
  590. by radius or number of units.  Default to 1 cell areas.
  591.  
  592. [need to identify motives for demand, if rtype not needed
  593. for actual survival - dyes needed for "art" for example -
  594. might vary between sides/unit types?]
  595. [would need to define generic elasticity of demands,
  596. also the profit-seekingness of a population (vs conservatism, etc)]
  597. [need some notion of credit too?]
  598. [units can effectively forage at some distance, distinguish foraging
  599. from actual production]
  600. [price should go up as material is transported further and further,
  601. and across varying difficulty of terrain...]
  602. [note that as sides, players can't force cell economy but can
  603. encourage it]
  604. [perhaps allow a side to fix a price artificially, let everything
  605. else readjust around it?]
  606. Sides can specify their trading relationship with other sides,
  607. by specifying the ratio of tariff to supply [etc].
  608. [trade relationship is indep of general trust/friendliness]
  609. [some type of agreements might be intrinsically enforceable, such as
  610. exchanges between units that cannot attack or capture each other]
  611. [exchange of material needs to relax fullness rules or be done as
  612. a sort of prim, else might not be able to trade when full]
  613.  
  614. Do supply lines, display unit's supplier and maybe supply route.
  615. Is there an efficient way to handle this?
  616.  
  617. To do large elev ranges, use bit 14 to indicate which range,
  618. define a global that gives ratio of ranges.  Also need a descriptor
  619. for text generation.
  620.  
  621. Add possibility to see some/all of a side's units if one of them is captured.
  622.  
  623. Weather needs pressure, humidity, calculates new values of these
  624. and also has effects on visibility at multiple levels of atmosphere.
  625. Need to identify effect of each terrain type (and elevation) on each
  626. of these, also specify the rate at which changes occur.
  627. Effects on supply.
  628. Effect on vision, sensing in general.
  629. Each utype has preferred weather, gradual falloff in effectiveness.
  630. Add a generic "violence" value that summarizes wind/storm strength,
  631. relate to unit behavior.
  632. Use season to get avg temp, perhaps regulate motions as well.
  633. Impl via weather phenomena - overcast/clouds, rain/snow, storms/wind,
  634. temperature, humidity (compute value of phenomena, then compute phenomena's
  635. effect on units).
  636. Attrition increased by storms, also chance of accidents (for each accident
  637. type).
  638. Could make some types of terrain temporarily impassable.
  639. Display should show fronts, major storms.
  640. Impl sequence should be fixed weather (weather state), random weather,
  641. seasonal weather, calculated weather.
  642. Implies that player-visible/settable state layers should be implemented first.
  643.  
  644. Compute a daily temperature cycle based on number of daylight hours etc.
  645.  
  646. @deffn UnitTypeProperty @code{weather-vision-range} dist
  647. [should be a table so can't see a long ways off from within forest?]
  648. @end deffn
  649.  
  650. The primary effect of clouds is to make things harder to see.
  651.  
  652. @deffn UnitTypeProperty @code{vision-cloud-effect} xxx
  653. @end deffn
  654.  
  655. Be able to play back a recorded sequence of weather during a game.
  656.  
  657. Distinguish "ideal" material level from "max" level, let
  658. some percentage of material move towards comfortable areas.
  659.  
  660. Scorekeeper can forbid the saving and restoring of a game, use in
  661. nonsecure situations.
  662.  
  663. Add a scorekeeper that looks at side view to decide whether player has
  664. discovered something that is to be searched for.  Should be able to
  665. require finding a lost city, etc.
  666.  
  667. Add option to scorekeeper to run on success/failure of an action
  668. matching given parameters, plus option to run on occurrence of a specified
  669. events, otherwise scorekeeper runs at either beginning or end of turn.
  670. Matching includes side and unit.
  671.  
  672. Add formal notion of money as a type of material that is global to a side,
  673. has no physical repn.  Materials such as gold can have a monetary value.
  674. Sides can force exchange rates or let float.
  675.  
  676. Add a "plague" random event/process that randomly spreads and moves around,
  677. use for fires, plagues, floods, etc.
  678. Could track state/progress by material layer or a "severity" layer.
  679. Perhaps use coating terrain for this?
  680.  
  681. [random clouds, etc]
  682.  
  683. [have random storms, increase chance in weather extrema if they occur]
  684.  
  685. DEF_TM_TABLE("supply-move-rate", tm_supply_move_rate,
  686.     "",
  687.     tmsupplymove, consttmsupplymove, 0, 0, 0)
  688. @deffn Table @code{supply-move-rate} t m -> n
  689. This table says how much of material @var{m}
  690. can be moved through terrain @var{t}
  691. (cell, border, or connection) in each material transfer action.
  692. The actual limit is the minimum of all cells and borders
  693. along the supply route.
  694. A value of @var{-1} allows any quantity to go through.
  695. @end deffn
  696.  
  697. DEF_UM_TABLE("supply-interdiction", um_interdiction,
  698.     "",
  699.     uminterdiction, constuminterdiction, 0, 0, 9999)
  700. @deffn Table @code{supply-interdiction} u m -> n%
  701. This table is the reduction of supply due
  702. to the presence of an enemy unit of the
  703. given type on the supply line.
  704. A value of @code{100} means that the unit has no effect on supply movement,
  705. a value of @code{0} means that the supply line is completely cut.
  706. Defaults to @code{0}.
  707. @end deffn
  708.  
  709. DEF_UU_TABLE("spy-see-always-chance", uu_spy_see_always,
  710.     "",
  711.     uuspyseealways, constuuspyseealways, 0, 0, 100)
  712. @deffn Table @code{spy-see-always-chance} u1 u2 -> n%
  713. This table is the chance that if @var{u1}'s spies return information
  714. about a unit of type @var{u2}, then that unit will always be
  715. visible thereafter, as if it were @code{see-always}.
  716. The compromised unit and its side will not be aware that
  717. this has happened.
  718. Defaults to @code{0}.
  719. @end deffn
  720.  
  721. @deffn UnitTypeProperty @code{spot-movement} t/f
  722. If this property is @code{true},
  723. then the unit's chance to be seen by other sides will be
  724. tested each time the unit moves.
  725. @code{spot-action} implies @code{spot-movement}.
  726. Defaults to @code{true}.
  727. @end deffn
  728.  
  729. @deffn UnitTypeProperty @code{spot-combat} t/f
  730. If this property is @code{true},
  731. then the unit's chance to be seen by other sides will be
  732. tested each time the unit engages in combat.
  733. @code{spot-action} implies @code{spot-combat}.
  734. Defaults to @code{true}.
  735. @end deffn
  736.  
  737. @deffn Table @code{see-combat-chance} u1 u2 -> n%
  738. This table is the basic chance to see a unit of type @var{u1} when
  739. in combat with a unit of type @var{u2}.
  740. The location of @var{u1} must be covered by some unit on the viewing side.
  741. This is evaluated for each combat action within a turn.
  742. Defaults to @code{100}.
  743. @end deffn
  744.  
  745. --Plans and Tasks
  746.  
  747. Add to move task to distinguish between "move and enter" and "move in open".
  748.  
  749. In some circumstances (which?), allow plan-tweaking commands to
  750. create and fill in the plan for an incomplete unit.
  751.  
  752. Add an ability to store and act on dated future plans and goals.
  753. Need to be able to evaluate preconditions for plan, so can do only
  754. if makes sense.
  755.  
  756. Doctrine and unit plans should include rules about when units should
  757. attack automatically.  Should be careful or will lose units to foolish
  758. actions.
  759.  
  760. Attack tasks should go after undamageable units,
  761. if less than perfect protection, damageable visible occupants.
  762.  
  763. Check on likely success of resupply task, if dubious, commit to forward
  764. motion.  Consult AI or human prefs?
  765.  
  766. Defense plan should identify what is defended, and what are the threats.
  767. If no threats, unit just tries to stay healthy.
  768. Defender's search for threats should cover a radius computed from
  769. defender's and ward's positions, areas covered by view, speed of threats
  770. (need to see bombers *before* they reach cities, can attack and retire
  771. before anybody can react).
  772. Threats can be recognized directly, or gotten from AI's list of threats.
  773. A unit is a threat if
  774. 1) it can capture or damage the ward
  775. 2) it can cut the ward off from supply or other defenders
  776. 3) it can hurt the defender
  777. To respond to a chosen threat, can 1) attack the threat, 2) interpose,
  778. 3) move the ward, either on own or by carrying.
  779.  
  780. Do better resupply algorithm.  Unit should decide what materials it
  781. needs, and in what time frame, picks ideal locations to get materials
  782. from, then if at one, waits or transfers supply in.
  783.  
  784. Do a large sideways move if all immediate directions are blocked.
  785. Only do once or twice before task fails.
  786.  
  787. "Intercept/defensive" plan directs units to patrol in an area, attacks any
  788. enemy unit (doctrine defines "enemy") that is of a type that can be
  789. attacked/harassed/blocked (ignore types that we can't do anything about!)
  790. Only some kinds of defensive units are interceptors, others are blockers
  791. or kept in reserve.  Blockers interpose rather than attack enemies,
  792. while reserves avoid contact until plan is changed.  Defn of "reserve"
  793. partly depends on attacker, so fighters intercept bombers but ignore
  794. battleships.
  795. Do as explicit decision in general defense plan.
  796.  
  797. Re-evaluate return if transport moving away too fast.
  798. Could have a "home" unit that is preferred if in range, such as
  799. fighters assigned to carriers.  Don't return to transports that
  800. don't have any fuel, unless there is no other choice.  Special-case
  801. grounding of aircraft if no supply in a base vs starvation of troops
  802. if no food in a base.
  803.  
  804. Exploration plan should set recon vs invasion type, use to decide
  805. about visibility while exploring.  Recon should attempt to gather
  806. knowledge without being seen.
  807.  
  808. If can refuel along a route if chosen correctly, subdivide move task
  809. so as to stop at refuel points.
  810.  
  811. Define a plan type that tracks/shadows units while staying out of sight
  812. as much as possible.  Would have to keep unit within view range but outside
  813. of its view range (and any other coverage, should write something to see
  814. whether a given cell might be visible to enemy), but may have to get
  815. closer to avoid losing trackee.  If unit being tracked seems about to
  816. do some damage, engage instead of shadowing.  May sometimes want to
  817. move to block or slow down trackee's escape.
  818.  
  819. Need special scenarios to be able to test all plan types accurately,
  820. should set up similar tests for all major parts of planning and AI code,
  821. each should ensure that all the code bits actually get executed.
  822.  
  823. Plans that fail to decide what to do are a potential problem, should
  824. eventually be replaced, but not too often or else warn about replacement.
  825. Track total usages as well as per-turn usage.
  826. Each successive plan for a unit should have a distinct serial number,
  827. display when displaying plan.  (units never share plans)
  828.  
  829. All units should get a chance to replan after acp/mp calculated
  830. but before anybody moves.  Should be fast, since nobody can move
  831. while this is happening.
  832. (Interface should be more obvious about this, so less confusion
  833. about turn change.)
  834. Give human players a chance to review plans made by high-initiative units
  835. before irreversibly made (flag review-plans, shows plans of units that
  836. are selected).
  837.  
  838. What about a task to not just resupply but to prepare for a long trip?
  839. Stock enough to make a crossing, etc.
  840. Check when doing an approach task, may want to push a "fillup" task.
  841.  
  842. Add notion of "supporting" another unit to doctrine, then unit could wake
  843. up and get involved automatically if combat nearby.
  844. Should specify by type & distance, as well as particular unit.
  845.  
  846. Do general org chart mechanism.
  847. Allow promoting any (or restricted type?) unit to be a commander, and
  848. assignment of units to commanders.  Cmdrs always move before other units,
  849. units can have orders to follow cmdr, cmdrs could have utype requisitions
  850. so production automatically goes to them.
  851. (Machine player could use this too.)
  852. Add a display to show how everything relates.
  853. Define a commander_decide_plan(cmdr, unit) or have cmdr make tasks directly?
  854. Each commander should have (or appoint) a deputy unit that will get its
  855. plan data if it dies.  If deputy dies, should work down through orgchart
  856. to find anyone, only giving up if entire group is gone.
  857. "Commander" plan is mod of other plan types, cmdr bit is for coordination.
  858. Cmdr plan includes an "ideal" mix of types to command.
  859. AI uses to set production, human gets told of cmdr unit's needs somehow.
  860.  
  861. If no AI or display on a side, what should units do?
  862. Will still have doctrine, attitudes, loyalties, so plenty to work from
  863. (include indepside in this but have no side-style coordination?)
  864. Can have and execute plans but no mechanism to change plans
  865. (i.e. can be read in but not altered thereafter - would need to flag?)
  866.  
  867. Should be able to set a "build rate" that is slower than "fast as possible",
  868. to avoid material depletion.  (i.e. use doctrine to set default rate of
  869. build actions, set actual rate in build task?)
  870. Define as amt of time to wait before starting build of next type (if the same).
  871.  
  872. Define a "meet" task where transport and occ (or whatever pair
  873. or group) converge on a mutually acceptable place.  Track progress,
  874. give up if not getting closer.
  875.  
  876. If hit/capture task fails because target has disappeared, offensive plan
  877. should search vicinity of target location for units of matching type.
  878. (But might be better to let generic task planning take over instead.)
  879.  
  880. Goal to move to an area should be satisfied by moving to nearest spot,
  881. instead of a random point inside.
  882.  
  883. Add an "engineering" plan type, with subtypes "make-access" and "block-access".
  884. Engineering units build access routes
  885. by adding/removing/modifying terrain, or by building units that serve
  886. only as bridges.  Should be able to build multi-cell/unit chains in
  887. difficult cases.  Examples: could bridge one blocking cell by a) building
  888. a transport unit that ferries, or b) building two connections.  Could
  889. bridge a single blocking border by building a connection or by removing
  890. border.  Want to do this for any cell that is very expensive to cross.
  891. To implement, plan should look for cheapest route assuming that blockage
  892. has been negated, then build bridges for that route.
  893. Engineers should also know how to build roads, do that if road movement
  894. is much faster (such as doubled) than normal movement.
  895.  
  896. Example doctrine for building-type games:
  897. (side-defaults
  898.   (doctrines (u* default-doctrine) (places place-doctrine)))
  899. (doctrine default-doctrine
  900.   (construction-run 1))
  901. (doctrine place-doctrine
  902.   (construction-run (u* 99) ((carrier battleship) 3) (nuke 1)))
  903.  
  904. --AI
  905.  
  906. For AIs, define a struct ai_ops (a la gdb) that includes all operations
  907. that AIs must support, call these directly instead of going through
  908. case statements.
  909. Move mplay.h into mplay.c, remove specific <ai>.h files from ai.c,
  910. move mplay.c to ai-mplay.c.
  911. Build (manually) registry of AI types somewhere, let game designs
  912. specify preferred or required types for particular sides.
  913.  
  914. Don't build transports if there is no way to get them to where they will
  915. be useful.
  916.  
  917. For each type of goal in game, decide which units help accomplish and how
  918. well, which units support indirectly, etc.  Also classify by short/long term
  919. value - short-term is 5-10 turns or 1/10 of game, long-term is length of game.
  920.  
  921. Set initial theaters to be identical to initial search zones, gradually modify
  922. to match terrain better.  (Theaters divide down middle of seas, etc.)
  923. Initial search zones should be from center of country in six dirs, subdivided
  924. by distance (increment should be 10, speed of fastest unit, 1/10 of world).
  925. Can use knowledge of country size to optimize search, by spacing out explorers,
  926. not filling in details of terrain until later (is diff, low-priority goal,
  927. maybe subsumed by patrolling).
  928.  
  929. Fix where town doesn't decide to build - happens when AI is assistant to
  930. display and town wakes up (enemy passing by) but doesn't already have a task.
  931.  
  932. Add ability to have future goals, ultimately be able to script much
  933. behavior.
  934.  
  935. Prefer to hit or capture transports, especially if easier way to bag
  936. or destroy the occupants.
  937.  
  938. Keep a persistent layer of "sightings" (or linked list if can be short),
  939. record into when nonempty cell in view array is about to be cleared
  940. during a turn (need hook from vision code).  Date sightings, clear
  941. periodically.
  942.  
  943. Neutrals should be run by AI, but act only in self-defense,
  944. other AIs should be aware of this.
  945.  
  946. Need a way to estimate units hidden in transports, so can freak out
  947. over approaching transports.
  948.  
  949. Compute desired number of depot types by calculating the spacing
  950. between necessary to ensure that each can supply another.
  951.  
  952. If only one builder available, should "timeshare" it properly.
  953. Plan should track what has been produced, reduce preferences more and
  954. more of a type gets built.
  955. Test with old-empire.
  956.  
  957. Add heuristics to try to build bases at key or useful locations.
  958.  
  959. Hit worth should be the general payoff of one-on-one combat.
  960. First test if combat possible.
  961. bhw = 0 means breakeven.
  962. bhw > 0 means always advantageous, < 0 disadvantageous.
  963. Should account for construction and fuel costs? (is "Strategic worth")
  964. In practice, tactical needs will outweigh the risks involved in fighting
  965. when bhw < 0.
  966. Also account for ability to escape, so less risk?
  967.  
  968. If scorekeeper body says something about testing possession on a given
  969. turn, then make occupation a goal from the start.
  970. If occupation goal unsatisfied, assign units to occupy, give each
  971. the same goal, should also attempt to clear the area.
  972. If satisfied, assign unit to defend the area (need to write "how
  973. to defend" code?), possibly patrol around if everything not always
  974. visible.
  975.  
  976. Speed up theater searches with a for_all_theater_hexes(th, x, y),
  977. that iterates between min/max x and y.
  978.  
  979. If contacted more than one side, choose a side to concentrate on
  980. (closest most likely), act defensively against other sides (but
  981. still take opportunities).  May need to change emphasis if another
  982. side turns out to be most threatening (tell this by tracking apparent
  983. success w.r.t. each side).
  984.  
  985. Shift from offensive to exploration if everybody disappears.
  986. Should be persistent in covering area near last spotting of units.
  987.  
  988. When a unit executes its plan, routines like find_target()
  989. either get a value from AI or search around (implicit "nobrains" AI?).
  990. (AI should have prioritized list of targets composed already and
  991. sorted by theater and goal etc.)
  992.  
  993. If parts of world view not necessarily up-to-date, need to do pickets
  994. or patrols to guarantee as much coverage as possible. (use view dates)
  995.  
  996. Designer should be able to toggle flags for mplayer,
  997. force reevaluation etc.
  998.  
  999. If moderate-to-high chance of unit surround, should put units in
  1000. lines and other formations that can't be surrounded easily.
  1001.  
  1002. A side should act primarily defensively if it satisfies a goal,
  1003. but the game is not over and another side could take away.
  1004.  
  1005. Guess at likely theater for contacts, carve out of existing theaters,
  1006. reassign/replan *all* units.
  1007.  
  1008. Track contacts with other sides on a per-theater basis.
  1009.  
  1010. Mplayer should compute which types are mostly likely to be in play
  1011. at present, and at future times.  Can look at initial setup, construction
  1012. times, etc, and ignore types that can't possibly appear.
  1013.  
  1014. Mplayer should attempt to compute numbers of units and material needed
  1015. to achieve a goal, to some level of confidence, then set "buildup" plans -
  1016. some units explore/patrol etc, then when buildup finished, should plan
  1017. large-scale attack, from several directions if possible.  Reserve units
  1018. should hang around transports, but not sit on them unless transport protected.
  1019.  
  1020. Use people sides to adjust theather boundaries sometimes. (how?)
  1021.  
  1022. If chance to surrender by siege > 5%, compute an ideal frontage, minimizes
  1023. chance of units getting isolated.
  1024.  
  1025. Could do formations by reshaping theaters.  Units mass on edge, don't go past
  1026. until AI directs an offensive.  If offensive successful, AI adds gains to
  1027. theater.
  1028.  
  1029. If returning to a moving transport, and transport destination is further away,
  1030. push a "wait" or "rendezvous" task onto transport's queue.
  1031.  
  1032. Be able to change theater size and shape as the situation changes,
  1033. let theater develop to optimal size.
  1034.  
  1035. For each theater, distinguish
  1036. recent vs older sightings, with exponential backoff (1-2 turns ago,
  1037. 3-5, 6-10, 11-20, etc).
  1038.  
  1039. AI should have a chance_to_own_one_of_type(side, side2, u) that the side's
  1040. current estimate of the likelihood of the given side2 owning at least one
  1041. unit of the given type.
  1042.  
  1043. Very small theaters should evaporate (how to recognize?).
  1044.  
  1045. Need special code to know how to defend bridgeheads, recent captures,
  1046. etc.  Reduce theater size or focus on immediate vicinity.  Own units
  1047. in "enemy" theater (define) should be defended against the most
  1048. immediate threats.  Look around for threats or potential threats.
  1049. Assign best units to deal with threats.
  1050.  
  1051. Need better weighting of hit prob vs death prob, also relate to goals,
  1052. so unit with low hit prob will still attack another unit if it can win
  1053. the game by doing so.  (implies we need to evaluate importance of goals,
  1054. nearness to achieving them)
  1055.  
  1056. Have machine player compute general dependency chains for its strategy.
  1057. For instance, "need miners to produce uranium from mountains
  1058. to build nukes to attack cities".
  1059. Should be "lazily" computed, as needed to achieve basic goals.
  1060. Strategy code works by calculating a plan that consists of steps
  1061. to reach the goals.  Plan is sufficiently detailed when side can
  1062. tell each unit what to do, or doctrine has the same effect.
  1063. Not always totally deterministic, how does this work?
  1064.  
  1065. Unit type analysis should be based on average outcome, plus worst/best-case
  1066. outcomes if not maybe not expecting enough action to let things average out.
  1067.  
  1068. To estimate materials, scan world, for each unit image, add survival
  1069. needs to min est, stockpile - avg operating costs to likely est,
  1070. total storage capacity to max est.  Can use actuals for own and allies.
  1071. Similar for terrain and population.
  1072.  
  1073. Unit first spotting human enemy should disappear as quickly
  1074. as possible, might escape before human notices. (exploratory plan only)
  1075. Purely exploratory/recon units should generally avoid combat, try to escape
  1076. and stay hidden if possible.
  1077.  
  1078. Resign if goals (as derived from scorekeepers) are provably unachievable.
  1079.  
  1080. Theaters of < 6 cells should be removed entirely.
  1081.  
  1082. To decide when to make bases, do if can create supply, can xfer from
  1083. further than units can, can protect units in or near base.
  1084.  
  1085. Do base construction as 1) moving to construction site, 2) building, and
  1086. 3) carrying to final site.  (Must verify that base or parts of base can
  1087. be carried.)
  1088.  
  1089. When exploring and switching theaters, shift both to inner and outer
  1090. theater (actually an abutting theater of any sort).
  1091.  
  1092. When enemy unit spotted in a zone, decide if unit is part of larger
  1093. group (like a country), what kinds of units might be present (similar,
  1094. sessile, etc).
  1095. If unit is isolated, decide if it is a threat in any way, if so, make
  1096. a goal "enemy gone from x,y" and assign units to work on this goal,
  1097. with types and numbers sufficient to the job.  Can borrow from nearby
  1098. theater if not too time-consuming.
  1099. If group, decide importance (home country being most important),
  1100. also assign # units, maybe make theater, track strengths, # units
  1101. enroute, and # still needed.
  1102. Distinguish units that are dangerous alone and ones that are carriers.
  1103. An army that is 2 cells away from capturing a self-unit should have
  1104. a maximal threat, since loss of game is certain if threat not counteracted.
  1105.  
  1106. Machine player should attempt to infer other sides' strategies.
  1107. side->strategy->other_side_analysis[nsides]
  1108. If no player on other side, record that other side will not do
  1109. anything (and go after to build territory).
  1110. If has a display, record as "more dangerous", use as a reason to
  1111. ally with other AIs in game.
  1112. Sides with displays should also be considered "more unpredictable".
  1113. If AIs ally, should be temporary, since game won't end even if all
  1114. are allied.
  1115.  
  1116. Define an "importance" of activities that gets divvied up among
  1117. subcommanders, so overall plans can be set aside temporarily while
  1118. individuals deal with immediate threats.
  1119.  
  1120. Machine player code should look for "choke points" that are standard
  1121. routes between important places and around obstacles.  Calculate from
  1122. world and utypes, share among all machines (don't use if haven't seen
  1123. yet!).
  1124.  
  1125. Write a stdplay.c that is only applicable if game is similar to standard
  1126. game (examine set of types, but still need to doublecheck numbers).
  1127. Share lower-level routines with mplay.c.
  1128.  
  1129. Eventually add code to negotiate for neutrality/ally status.
  1130.  
  1131. Add a player slot that can be used to set explicit AI goals, would
  1132. take precedence over computed goals.
  1133.  
  1134. Mplayer should be make goal forest instead of just a list.
  1135.  
  1136. Mplayer should prefer goals with fewest dependencies (prereqs) and
  1137. quickest time to completion.  Prereqs mean conditions that must be
  1138. true before main goal is worthwhile attempting, but are not formal
  1139. requirements - goals are intrinsically self-contained.
  1140.  
  1141. Get goals from a hash table instead of creating anew each time.
  1142. Parameters of goal will be read-only.
  1143. get_goal(type, p1, ...)
  1144. change_goal(goal, newtype, newp1, ...)
  1145.  
  1146. Scorekeeper analysis:
  1147. if keeping score
  1148.   make overall goal to win
  1149.   call make_subgoals
  1150. else amuse self by being random
  1151. if goal is to win
  1152.   for each scorekeeper
  1153.     if last-side-wins, ... (already done)
  1154.     else scan body looking for if's and do's
  1155.     (might be too complicated, should announce the fact as a warning
  1156.     "too complicated for me, don't know how to play" and drop
  1157.     back to simpler if mistaken goals)
  1158.     if body is "(if <test> win/lose)"
  1159.       make the satisfaction of the test a goal
  1160. if goal is to make a side lose
  1161.   if can be accomplished by eliminating a side's nonzero-value units,
  1162.   set goals to destroy/capture each type
  1163.   if not all visible, set goal to find units
  1164.     if type can move, goal is to keep info about world up-to-date;
  1165.       no random walking, always move to update oldest spots (but
  1166.       only in terrain where units could be)
  1167.     if type can't move, goal is to have examined all possible
  1168.       terrain.
  1169.  
  1170. --Interface
  1171.  
  1172. To choose contour interval for elevation display, get actual elev range
  1173. and subdivide into equal intervals, or define a "standard interval"
  1174. and multiply if would result in too many lines on map (> 1 line between
  1175. cell centers is too much).
  1176.  
  1177. Generalize X11 machinery for controlling mplayers hogging all cpu time
  1178. and moving too quickly.  Characterize as *interval* between calls, so
  1179. mplayers act more slowly if more calculation required for each move.
  1180.  
  1181. Add an imf procedure to compute actual bbox of nonzero bits/mask in an image.
  1182.  
  1183. Nightfall should update cells from the top down.
  1184.  
  1185. When drawing elevation changes, draw a gray line at cell edges to indicate
  1186. the "crease".
  1187.  
  1188. To indicate slope, draw center of cell with shape for next smaller mag,
  1189. then sloping rects joining adjacent edges of cells, then triangles around
  1190. each 3-way meet (for hexes anyway) to fill in holes.
  1191.  
  1192. Should not be able to appear to attack if attack not allowed
  1193. (arty in ww2-bn for example).
  1194.  
  1195. Compare 5.5.1 commands, tweak standard commands to match if reasonable.
  1196.  
  1197. Add designer save option to write only some props of a unit, such as
  1198. position, and write as (unit <id> <props>), using name, number or id
  1199. as identifier.
  1200.  
  1201. Use generic names when summarizing types at a location or in a transport.
  1202.  
  1203. Add a side->ready_to_start that each player must enable before actual
  1204. game play starts.  Initially false for all sides, mplayer sets when
  1205. init done, interfaces enable at player's direction.  Could be button
  1206. or implicit when player tries to move.  Note that if multiple humans, and
  1207. one tries to move, move will not actually happen until everybody either
  1208. tries to move or else clicks on the start button.
  1209.  
  1210. Define special-terrain-images, allow values like
  1211. (beach (terrain (ne sea) (half (n sea) (s beach)))
  1212.        (border (w nw) river)
  1213.        "beach&sea&river-1")
  1214.  
  1215. When "view" of cell becomes an "exact view", do an update of it.
  1216.  
  1217. Interface should indicate a "move near" plan with a multiple lines
  1218. indicating radius.
  1219.  
  1220. Redraw cells even when coverage becomes zero?
  1221.  
  1222. Standardize image names more:
  1223. [<game>-]<picture>[-<era>]
  1224. [<game>-]<function>[-<size>][-<era>][-<side/individual>]
  1225.  
  1226. Add "angle" and "facing" properties to images, and "dirmask" for
  1227. linears.  What about combined ttypes (beach + sea, etc)?
  1228.  
  1229. UI data save should have format
  1230. (ui-data <generic-props> (mac ...) (xlib ...) ...).
  1231. Use {read,write}_generic_ui_data(fp, side) that does generic stuff, and
  1232. calls to {read,write}_ui_data to do interface-specific bits.
  1233. Copy other interfaces' data through, but don't mess with.
  1234.  
  1235. Direction chars in dir of blocking terrain but adj to a slideable
  1236. border should cause a border slide.
  1237.  
  1238. Linear terrain should be affected by night - draw half-black mask.
  1239.  
  1240. Command "ai" toggles between default aitype and none, while "ai <name>"
  1241. switches to particular ai type.
  1242.  
  1243. Add ability to switch to alternate color/icon schemes, such as
  1244. winter camouflage for panzer, or military vs pictorial icons.
  1245.  
  1246. Add mechanism so that messages get echoed back, for confirmation
  1247. of contents mainly.
  1248.  
  1249. Fix interfaces so that only one base gets ordered to be built, but lots
  1250. of infantry from cities.  (in doctrine, feed to interface? - needs to
  1251. be part of default doctrine for all sides in a game!)
  1252. For standard, do
  1253. (side-defaults (doctrines (u* default-doctrine) ((* @) city-doctrine)))
  1254. (doctrine default-doctrine (construction-run (u* 1)))
  1255. (doctrine city-doctrine (construction-run (u* 99) (nuke 1)))
  1256.  
  1257. When displaying perspective, show top and bottom of "thick" terrain.
  1258.  
  1259. If command arg spec is just "*", then make all command args into
  1260. a single string, passed directly to command.
  1261.  
  1262. For textual commands, interpret <tab>, extend words, etc.
  1263.  
  1264. Detect image and image family conflicts/overrides when interpreting imf files,
  1265. warn about unless suppressed.
  1266.  
  1267. Handle some glimpses as special event types, such as spotting occupants
  1268. in a unit, instead of trying to draw on display somehow.
  1269. Call glimpse_unit(side, unit).
  1270.  
  1271. Don't say, for instance, "independent 2nd wreck" in textual displays,
  1272. but just "wreck" - both in topline displays and narratives.
  1273.  
  1274. A game design should be able to specify a per-side optimal centering
  1275. for the initial view.
  1276.  
  1277. Add some kind of sort key control to help info for commands.
  1278.  
  1279. Add more help nodes to explain general concepts like acp.
  1280. Describe each general concept that is enabled for the given
  1281. game, otherwise say "no xxx in this game".
  1282.  
  1283. End-of-game stats should use own system for double-entry bookkeeping.
  1284. (should display discrepancies only if nonzero)
  1285.  
  1286. Add generic commands to go up and down ('^', 'v' perhaps)
  1287. How should they be interpreted?
  1288.  
  1289. Allow definitions of images that constitute the border between two given
  1290. ttypes, or t1/t2/border combos, etc.
  1291.  
  1292. Add image properties that indicates approximate orientation and
  1293. direction being viewed from (side, top, 30 degrees, etc).
  1294.  
  1295. Draw some features by using boundaries, of different appearances.
  1296.  
  1297. Need a way to indicate relative precedence of sort keys in list windows.
  1298.  
  1299. When in mono, allow choice of small numbers or letters for side, instead of
  1300. emblem.
  1301.  
  1302. At high mag powers, draw people emblems near borders of hex instead of in
  1303. middle.  (when emblem width < 1/4 cell width)
  1304.  
  1305. Define a -h <n> that sets up and waits to get pings from human players.
  1306. Like -e <n>.  Kernel only has "wait for <n> remote players", cmdline
  1307. does the -h part. -wait <mins> to say how long to wait before going
  1308. ahead, also allows players to get impatient and start anyway.
  1309. Ideally, the startup host gets a window or command interface
  1310. to control the startup process, see who is in, perhaps edit
  1311. display specs.
  1312. All player specs should be able to add "+n" to adjust advantages,
  1313. as in -e 4+2, +2 alone (one mplayer, +2 advantage?)
  1314.  
  1315. Players should be able to join above by doing "xconq -join host nnnn [-help]".
  1316. Help shows description of game and list of players/sides; say "(available)"
  1317. if side is waiting for a player, ask terminal for a side number to join in on.
  1318. Serving game must open a socket to listen.  If under X11, program can quit
  1319. once display is open; for others, program will continue to run.
  1320.  
  1321. Define some common part of imf reading and interpretation in kernel
  1322. or a common support lib, extend basic image structs with interface-specific
  1323. detail:
  1324.     struct imf { common com; specific icon,... }
  1325. Common includes size ranges and maybe depths.
  1326.  
  1327. Some images in imf may be precalced for a hex or other shape,
  1328. need to indicate specially.
  1329.  
  1330. Game should be able to spec relative or absolute widths of borders
  1331. and connections (used when solid or a pattern).
  1332.  
  1333. If multiple conn/bord types, interfaces should draw them offset slightly from each
  1334. other.
  1335.  
  1336. Should be able to, from cmdline, list available player slots in a remote
  1337. game without actually trying to get in.
  1338.  
  1339. (is sort of done now)
  1340. Allow adding a hole or mask to add side emblem to units (plus offset?).
  1341. Specify as (image ... (emblem-space x y w h) ...)
  1342. Also, each image can declare that an emblem is already embedded, as
  1343. ... (has-emblem <emblem-name>)... (would still draw actual emblem if
  1344. it didn't match the embedded one - leave embedded one, may be useful info)
  1345.  
  1346. Should be able to parse dates in commands,
  1347. omit parts that are same as current value (such as year).
  1348. Date string function should cache stuff, so not always allocing new
  1349. strings.
  1350. Length of a turn specified as "<n> <unit>" where <unit>
  1351. is known to calendar type.
  1352. Robustify the base date parsing.
  1353.  
  1354. Add a text parser etc for specifying units and types.  parse_[urt]type,
  1355. parse_unit should be able to recognize ambiguous matches, either return
  1356. # results or report of multiple, be able to process each independently,
  1357. put in dialog, etc.  parse_feature to locate geo geatures by name.
  1358.  
  1359. Need keywords for images to tie less specific images at smaller
  1360. scales to more detailed ones - "su-85" -> "tank", etc.
  1361.  
  1362. Kernel should deliver basic formatting info in help text, let interface
  1363. digest - need line breaks, text fill, tabs/tabstops, emphasis/bold (use
  1364. ^B,^P,^I chars?).  Perhaps some way to name a picture and let interface
  1365. fill in actual picture.
  1366.  
  1367. Do something in general for reporting destinations, choices are
  1368. raw coords, dir/dist, or a dest name of some sort (unit or region).
  1369. Useful to have optional map scale to report distances in miles etc?
  1370. Examples: "in xxx country" (needs defn of country)
  1371. (define gvar "start-area-name" that gives name?)
  1372. "NE of country" "E of Foo Bar" "in <region>"
  1373. Function is position_desc(buf, side, x, y), where side==NULL means
  1374. do for omniscient side,.
  1375. also define position_desc_relative(buf, side, x, y, x2, y2).
  1376.  
  1377. If info is always accurate and up-to-date, calculate display directly
  1378. from state.  If might be unknown at first, but always accurately
  1379. known once discovered, keep a bit/piece of info, display from state
  1380. if bit is on, else show nothing.  Similarly for info that might
  1381. get out of date if observer not present?
  1382. If info might be known/unknown and right or wrong, then must maintain
  1383. full copy, though can forward to real state if internally known to be
  1384. accurate.
  1385.  
  1386. Add imf property for additional info about an image. (explanation/derivation,
  1387. aimed more at game designers).
  1388.  
  1389. Add option to draw contour lines for elevations.
  1390. Contour intervals should be based on range of actual elevs, but let
  1391. player adjust (perhaps by looking at histogram of elevs).
  1392. Game design specifies color of contour lines.
  1393. Draw for each of six triangles P0P1P2 in a hex.
  1394. Pick two corners with elevs e0 and e1.
  1395. For each contour elev ec between e0 and e1
  1396.   If e2 > e1, no contours go to the e1e2 side
  1397.   If ec between e1, e2
  1398.     Draw line to e1e2 interpolation of ec
  1399.   If ec between e0, e2
  1400.     Draw line to e0e2 interpolation of ec
  1401. End
  1402. For each contour ec between e0 and e2
  1403.   If ec between e0,e1
  1404.     Draw line to e0e1 interpolation
  1405.  
  1406. Add designer tool to paint theaters for AIs.
  1407.  
  1408. In perspective view, displace units by both elevation of cell and their
  1409. altitude above it, maybe draw shadow on ground if airborne.
  1410. Center unit in cell better (?).
  1411. Shade slopes in perspective view according to time of day.
  1412.  
  1413. To support multiple natural languages, associate one of several languages
  1414. with each side, use to invoke nl-specific nlang.c/help.c routines.
  1415. Also have separate command definitions (de-cmd.def, fr-cmd.def, etc)
  1416. that interface should be able to use instead.  Each interface, if configured
  1417. for it, will have to set up all the command tables, so can be chosen
  1418. by each side at game startup.
  1419.  
  1420. Document that Unix-hosted versions must provide void close_displays()
  1421. so that signal handlers may call.
  1422.  
  1423. Add interface-independent printable display of all help info.
  1424.  
  1425. In printed map, make grid be gray, draw only around known-about terrain.
  1426. Draw area edge in light gray if adj cells not known terrain.
  1427. Use halftones or patterns instead of bitmaps possibly, add a
  1428. color -> grayscal translation process.
  1429. General cmd should be "print [window] [width]", where saying "window"
  1430. limits to contents of a window (else whole area is printed), and width
  1431. gives physical width of map, default is to fit on one page.
  1432. Each page should include a legend showing terrain, units, sides, use
  1433. up to four columns at bottom of page, run types together in columns to
  1434. save space. (Ditto for text/ascii view.)
  1435.  
  1436. Common printing code handles layout setup, layout checking, and actual
  1437. computation of printed view.  Interface handles any print setup dialog,
  1438. plus final disposal of printed view (to file, to print queue, etc).
  1439.  
  1440. At end of a turn, display summary/histogram of action/task/plan types
  1441. and outcomes. (debugging display?)
  1442.  
  1443. Need a general (all-interface) strategy for guaranteeing image
  1444. consistency on screen.
  1445.  
  1446. Add ability to select direction of perspective view.
  1447. Easier if only one of NUMDIRS dirs allowed.
  1448.  
  1449. Clarify rules of how immobile units get on transports.
  1450.  
  1451. When autoscrolling, interfaces should support a brief delay option so that players can
  1452. see the outcome of a unit's last move for the turn.  Can omit if next unit is close by
  1453. and no scrolling was needed.
  1454.  
  1455. Add ability to supply phrases for table row display in help:
  1456. "[can create] by default, [except for] base,town,city".
  1457.  
  1458. --Coding
  1459.  
  1460. Write a generic interpolate_in_list(val, lis) that computes a value using
  1461. the value pairs in the list, use for all things that are a list of pairs.
  1462.  
  1463. Implement "may-see-all" and "see-all" as a side flag in kernel, use instead
  1464. of g_see_all everywhere.
  1465.  
  1466. In lisp.c, be smarter about ptrs to line numbers passed into reader,
  1467. do nothing if they're NULL.
  1468.  
  1469. Make gamestatesafe, interfacestatesafe visible everywhere.
  1470.  
  1471. Loop through vardefns[] to write out globals instead of including
  1472. gvar.def and expanding into separate code for each.
  1473.  
  1474. PS printing (should?) require ui.c and imf.c.  Include a configure option to add/remove
  1475. PS printing code.
  1476.  
  1477. Put some/all info subwin text gen into ui.c or nlang.c, as appropriate.
  1478. unit_or_view_info(side, x, y, unit)
  1479. cell_info(side, x, y)
  1480.  
  1481. unit->side != indepside, always!  (how to check?)
  1482.  
  1483. Add a side->allow_entry[s][u1][u2] that says allowability of unit entry
  1484. into transports (use for indepside also).  Seed with 1 for all pairs
  1485. of types if side is trusted.
  1486.  
  1487. When recalculating coverage, detect discrepancies, warn about?
  1488.  
  1489. Write goals as separate forms, make xrefs to them.
  1490.  
  1491. Record the global state when becoming a designer, be able to write out
  1492. deltas only.
  1493. Be able to select only particular properties + unit id to write out.
  1494.  
  1495. Eliminate USE_CONSOLE from kernel, decide with a runtime flag.
  1496.  
  1497. unit_desig should format typename into minimum space, determined dynamically.
  1498. Assign chars, if defined, as shortest names, then add longer names to
  1499. uniquify names after the first using a particular char.
  1500.  
  1501. In theater summary, don't print "people" if no people of any type are
  1502. present.
  1503.  
  1504. Allow multiple -L specs for libraries, support list of library dirs to search
  1505. for a module.
  1506.  
  1507. Collect/write stats on each call to run_game - # unit scanned, # acted,
  1508. # actions, # plan executions.  Also classify by type and side.
  1509.  
  1510. In initial game analysis, calc which utypes can be on which sides,
  1511. stash with side info.  For AIs, also stash guess about first turn
  1512. of appearance?
  1513.  
  1514. For each scorekeeper, add an internal flag that saves applicability
  1515. of scorekeeper, also calc for current turn - if changed, then AI
  1516. analysis code should re-run.
  1517.  
  1518. Write a search_straight_line(x0, y0, x1, y1, fn) that scans
  1519. exact line between places.  Could also do 3d version.
  1520.  
  1521. Be able to save individual properties along with ids to match with units.
  1522.  
  1523. Add option to save a map rotated, at least by 60-deg increments.
  1524. 60 left, 1st hextant formula is y' = x + y, x' = -y, etc.
  1525.  
  1526. When lots of mallocs being recorded, either maint enough space to
  1527. record all, or else drop/combine smaller totals to make room to
  1528. record the big allocs.
  1529.  
  1530. Write dice specs as dice specs, not large numbers.
  1531.  
  1532. Use 16-bit indices to an array of pointers to units.
  1533.  
  1534. Add a kernel routine notify_all that goes to all players with displays,
  1535. requires ack from all, support voting and timeouts.
  1536. Use in x/xt version for run errors etc.
  1537. (is this really useful?? could be a general multi-player alert
  1538. with voting/ack requirements)
  1539. multi_alert(msg, sides, [minquorum, mintopass], timeout)
  1540. multi_query
  1541. update_multi_query_display
  1542. interface calls ack_multi_query
  1543.  
  1544. Define zz-s-u-n as cache for shortest name (down to 1 char if possible,
  1545. but confusing if only some have one-char names, others are all-but-one
  1546. char of name, etc)
  1547.  
  1548. Define a can_occupy(...,exclunit) that indicates room if given other
  1549. unit is *not* counted (since it will be removed shortly, for instance)
  1550.  
  1551. Make a bit vector of allowed sides for each type.
  1552.  
  1553. Define performance as a sort of ratio to specmarks, so benchmark game is
  1554. known to last 2 minutes on a 100-specmark machine, etc.  Use -R 1, only
  1555. "real" games, various mixes of AI, little/no interaction.
  1556. Games should include classic, standard, gettysburg, magnusvew, ww2-eur-42.
  1557.  
  1558. Doctrine consists of a list of modifications to a single doctrine object
  1559. that is final answer (no doctrine relationsships).  Can always clone a
  1560. doctrine but then is severed from original.
  1561.  
  1562. Add general check on parameter bounds as given in *.def.
  1563.  
  1564. Define foo_text(buf, n, xxx) where n is available space for description,
  1565. return actual length of text in buffer.
  1566. To get strings, define foo_string(xxx), which returns a 0-terminated string.
  1567.  
  1568. For all units on a side, keep sorted by type, keep ptrs to start of each
  1569. type, use to index faster.  Could even maintain separate chains for each type.
  1570. Define a for_all_side_units_of_type(side,type,unitvar) iterator.
  1571.  
  1572. Implement a convex region finder that works by picking random points as seeds
  1573. and grows out from those.  Sides have to be "locked" if entire side can't
  1574. all grow - combo of locked and unlocked sides allows region to become
  1575. parallelogram, triangle, etc.
  1576. How should borders and connections affect generic region finding?
  1577. Grow from random points until about 3/4 of cells in regions, then scan
  1578. down to finish off.  (Could leave single points as "their own regions",
  1579. not alloc any region structs.)
  1580.  
  1581. General path objects consist of multiple segments, each with start/end
  1582. point and a validity test (that can be done at any time).  Also include
  1583. a bit with segment saying "shortest" or just "nonincreasing distance".
  1584. Should be possible for a path to say "impossible" for some segment??
  1585. (consider path that consists of land travel segments plus a sea hop
  1586. that needs a ferry of some sort - path is still valid and useful.)
  1587.  
  1588. Regions should
  1589. point to super-regions, not necessarily contained.  Include bits for
  1590. caching connectedness, terrain percentages, etc.  Add region layer to
  1591. regular map (each hex can only point to one region, multi-stuff must be
  1592. between regions).  Need commands to define and display regions.
  1593. Regions never overlap, must subdivide and make subregions be included
  1594. in several super-regions.  True for all regions, don't do multiple
  1595. "region layers" (unless significantly more efficient?  check stats).
  1596. Add region layer for mplayers that need to explore, add to layer
  1597. as mplayer sees stuff.
  1598.  
  1599. Theory of networked Xconq is that all copies synchronize on actions
  1600. and random seeds, then do run_game and get identical results.  Each
  1601. program will broadcast its planned actions, then wait until each other
  1602. program indicates that it has sent all that it plans to.  When a program
  1603. has received "done" from all others, then it can safely execute.
  1604.  
  1605. Allow various combinations of multiple- and single-server games.
  1606.  
  1607. For any routine in the interface that tweaks in the kernel, have to
  1608. siphon it off to the network also.  Do via compiling interface with
  1609. augmented calls, so kernel code need not be modified to know about
  1610. networking.  On receiving side, input mux includes a decoder that
  1611. invokes kernel routines (note that decoder has to know about calls
  1612. that not all interfaces actually support, since less-powerful
  1613. interface may get kernel-changing messages from more powerful interface).
  1614.  
  1615. Build a "skelclient" from skelconq.c and client.c.  client.c includes
  1616. a "wait_for_server" that calls run_game or just accepts outcomes and
  1617. state changes from the server.
  1618.  
  1619. Come up with a way to prove that mplayer doesn't cheat by looking
  1620. at structs?  Could have a have a "sneaker" that is always invisible,
  1621. never attacked unless mplayer cheats.
  1622.  
  1623. Add tests involving two communicating skelconqs with preset port
  1624. numbers, use to test networking behavior.  Use a skelconq and Xconq
  1625. on Macs to test PPC (or GUSI?)
  1626.  
  1627. Add a protocol version number etc so that mismatched versions can't
  1628. connect.
  1629.  
  1630. Further compress layers by including info about # bits (1,8,16).
  1631.  
  1632. Define a "text buffer" object that is variable-size, resizes as needed,
  1633. do all printfs into it.
  1634. To guarantee integrity, program could display checksum or signature to players
  1635. upon startup, so they can agree as to identity of program.
  1636.  
  1637. To do play-by-mail games, need to be able to save an optionally encrypted game
  1638. and pass along to next player -
  1639. player info includes some sort of bit indicating
  1640. where to send to. (player-address slot)
  1641. Encrypted game should retain game-module form as plaintext,
  1642. include a "password" slot, then all numbers appearing at "top level" will be
  1643. decrypted, random forms still read normally.
  1644.  
  1645. Optimize mapping side and unit ids back to objects themselves.  Use hash
  1646. table for units, direct table for sides.
  1647.  
  1648. For tables, merge index1,index2 slots into one char(?) slot.
  1649. Make keyword value a char.
  1650. Set up table(type?)s in dynalloc space, sort for efficiency in search.
  1651.  
  1652. When saving elevations, always save as 0-based + addend values, doing
  1653. multiplier less important.
  1654.  
  1655. Use obstacks for building up help text.
  1656.  
  1657. Finish writing game compiler, test, collect speed comparisons.
  1658.  
  1659. Historical events should always be unique; check for duplications and
  1660. complain or avoid creating when restoring a game.
  1661.  
  1662. --Documentation
  1663.  
  1664. Infoize manual, improve online appearance.
  1665.  
  1666. Remove mentions of u_storage, t_storage in document?
  1667.  
  1668. Document that acp-per-turn and ...-min both default to 0.
  1669.  
  1670. Document that acp-per-turn-max defaults to -1, which means acp-per-turn limit.
  1671.  
  1672. In hacking.texi, doc that language can't change if *.def untouched.
  1673.  
  1674. Add html-ization for manual.
  1675.  
  1676. Describe parameters of actions.
  1677.  
  1678. Build syntax.texi by replacing <unit-type-property> with actual list of
  1679. names extracted from utype.def.
  1680.  
  1681. --Testing
  1682.  
  1683. Write tests for resignation, draw, win, lose situations.
  1684.  
  1685. Add testing machinery for the graphical interfaces.
  1686. Could have AIs play each other on multiple screens.
  1687.  
  1688. Add a (quit [if-end]) command to skelconq that exits.  With if-end,
  1689. only exits if at end-of-game.
  1690.  
  1691. Instead of scanning lib dirs wholesale, make up a list of combinations
  1692. of game and variant options to run.
  1693.  
  1694. test-lib should run all the useful -g options (use game.dir to collect).
  1695. Then run a script to discover which modules are never
  1696. loaded by any library game.
  1697.  
  1698. test-lib-modules should just load each module then quit - looks for
  1699. immediate crashes due to player error.
  1700.  
  1701. Set up basic "make check" to run limited tests on library and standard
  1702. test cases, when defined.
  1703.  
  1704. Set "make ai-check" to run long AI tests.
  1705.  
  1706. Add more directed tests as DejaGnu tests.
  1707.  
  1708. For running tests, use explicit -L to lib and test dirs.
  1709.  
  1710. Finish adding test images to test.imf.
  1711.  
  1712. Add tests for end-of-game handling.
  1713. Set up some lib games with non- or feeble sides, so one side wins
  1714. more quickly, plus heavily lopsided advantages.
  1715.  
  1716. Add save/restore tests, require that diffs of successive save/restores
  1717. are either empty or of a known format (assume calls to run_game can be
  1718. controlled by skelconq).
  1719. To test save/restore of tables, dump out help info separately and
  1720. compare after restoration.
  1721. Also use compiler and compare its output.
  1722.  
  1723. Add a test of external synth program.
  1724.  
  1725. Add a source-scanning test to find possible calls to rand() or random().
  1726.  
  1727. Reflect GDL changes in all.g, add a scanning test to ensure that is
  1728. consistent.  Run all these automatically as part of "make gdl-check".
  1729.  
  1730. --Library
  1731.  
  1732. Set standards for names of library files:
  1733. case-insensitive, hyphen/underscore equiv, max of 11 chars for
  1734. name, 8 chars unique (algo - remove hyphens/underscores, then vowels),
  1735. 3 chars after dot.  Write a name analyzer/checker, DOS code should
  1736. do name reduction algo when trying to open a long name file.
  1737. game.dir -> game_dir. for DOS.
  1738.  
  1739. Recognize "color" images that are really just B/W, read/write as B/W.
  1740. (mac only??)
  1741.  
  1742. For X11, make imf2x/x2imf translate bitmap filenames and struct names
  1743. properly.
  1744.  
  1745. WWII scenario should be able to have a "neutrals" side that resists
  1746. involvement.  Attempts to attack neutrals should have some consequences.
  1747. Spain and Turkey should be neutral, but if attacked, will go over to
  1748. other side.  (This should be recorded in the scenario as a preset
  1749. property of those AIs!)  AIs on opposed sides should assess value
  1750. of capturing side's units vs expense & risk of combat.
  1751.  
  1752. For napoleon, make all cities visible, view all units once/month,
  1753. but don't be see-all.  Unit positions can be kept more up-to-date
  1754. by spies, or say that all units can spy out to 4-5 cells and all
  1755. cities are always spotted - so movements around and through are
  1756. always known about.
  1757.  
  1758. Add more 16x16 panzer images.
  1759. Eliminate slope terrain, replace with hilly or rough.
  1760.  
  1761. Gettysburg brigades should vary in quality and hp.
  1762.  
  1763. In pelops, try to model Athenian grain trade (abstractly or concretely?)
  1764. Constrain eastmed map to about sicily-sardis, lissus-crete area.
  1765.  
  1766. Change stdunit so that only towns and cities count, not armies?  Will
  1767. require better defensive operations.
  1768.  
  1769. If fighters had a low land/takeoff time, then could attack adj bombers
  1770. a lot more than now (realistic), but bombers can't escape then, unless
  1771. some sort of generic auto-retreat implemented (a good idea).  Auto-retreat
  1772. might happen in addition to the hit, rather than instead of the hit.
  1773. Refuel should consume part of flying time, but not all, then can
  1774. fly many sorties against nearby targets.
  1775.  
  1776. Skelconq should examine lib.imf directly during setup, report
  1777. on which images were found for the game being loaded.
  1778. (Not error, because interfaces not required to use image library.)
  1779.  
  1780. Collect all old games, do partial translations.
  1781.  
  1782. Image tools should be able to study colors and colorized images
  1783. usefully somehow.
  1784.  
  1785. Let images refer to colors by name.
  1786.  
  1787. Make new world maps that use connections for straits and rivers.
  1788. Distinguish navigable/unnavigable rivers?
  1789. (extra layers should be optional - could do "ifdef river type")
  1790.  
  1791. Add notion of named palettes to .imf files, in form
  1792. (palette name color1 color2 ...)
  1793. then images can refer to palette by name and colors by index.
  1794.  
  1795. Modify standard game to be more resource-bound, supply used up
  1796. faster, all units must be kept supplied, need to build strings of
  1797. bases to get supplies out to where needed.
  1798.  
  1799. Write a ww2-std-pac-42 scenario with Allies (including Soviets?)
  1800. vs Japan.  Immediate post-Pearl.
  1801.  
  1802. Change ww2-div-pac to include diff sizes of ground units (reg, bde,
  1803. marine bn, inf-bn, marine-div).
  1804.  
  1805. In ww2-std-eur-42, add Suez as base, make Mecca be a base, mention in
  1806. notes that Egyptian cities represent ME/Africa/India supply sources.
  1807.  
  1808. In ww2-eur-42,
  1809. Swiss, Spain&Turkey should be inaccessible, also remove any indep cities.
  1810. Sweden inaccessible?  Add 3-5 rows to top of map.
  1811. More US cities for balance, more depth to USSR (move existing cities west).
  1812.  
  1813. WWII strategic games should have large number of predefined agreements
  1814. constraining players.  Add more pre-existing units to all sides.
  1815. Fleets should take longer to build?
  1816. Add "Axis/Allied minor" sides that include Balkans, etc.
  1817.  
  1818. Capturing city in advanced ww2 should cause immediate side change
  1819. in cell.
  1820. Add handling of oil as resource - inf needs little, armor needs lots,
  1821. but only to move.
  1822.  
  1823. Add night option to panzer, add area illumination so that wrecks
  1824. can illuminate immediate area.
  1825.  
  1826. For Normandy, set up staging areas for German reinforcements to arrive from.
  1827. Set German AI to be primarily defensive.
  1828.  
  1829. In flattop, gen names like "LC-1", "CA1", etc.
  1830. Allow stacking of ships - 4/cell.
  1831. Let subs be in same cell as enemy surface ships, let dd's attack there.
  1832.  
  1833. --Game Ideas
  1834.  
  1835. "Quest"
  1836.  
  1837. For one player usually, starts out as a vagabond with limited materials.
  1838. Either convert self to higher "rank", or else have improved capability
  1839. via experience points and more equipment (but what would "equipment" be
  1840. good for exactly?).
  1841. Can capture other humans, animals, etc, use as assistants of variable
  1842. loyalty.
  1843. Terrain is standard.  Include rivers and roads, with significant effects.
  1844. Units would be various cities/towns/villages, usual (wandering?) monsters.
  1845. Could have a machine-run side that seeks to capture/kill player, like a
  1846. police force or army (or assassins?).
  1847. Have ships for crossing oceans (but need to "buy" somehow, and if in town,
  1848. town should be on coast).
  1849. Include weather/seasons with significant effects.
  1850. Need unit/material as object of quest, perhaps different kinds for
  1851. different games.
  1852.  
  1853. (Need to be able to enter/leave neutral places without capturing, but also
  1854. be able to accept surrender - perhaps a notion of "if a place is indifferent
  1855. to your existence, can interact without combat".  Extend to hostile places
  1856. that you can sneak in and out of, though at some risk.)
  1857.  
  1858. Should predefine all sides(?), but allow multiple adventurers and only one
  1859. monster side - lock this side so players can't take it (but not always?)
  1860.  
  1861. To make a game of graduated difficulty, make a long horizontal world, put
  1862. player at one end, goal at other, lots of monsters in middle,
  1863. tougher ones further away.  (Monsters should move around a little,
  1864. but not overwhelm player instantly - could make "electric fences" of
  1865. ttypes crossable by player but not monsters, so even fast monsters confined.)
  1866. Would look like a string of sausages - 1600x40 world is approx equiv to
  1867. 40-level dungeon.
  1868. Won't be computed incrementally though, but could schedule creation
  1869. of high-level monsters to be later in game, make a snowball effect where player
  1870. faces huge numbers of monsters if too slow at first.
  1871.  
  1872. To make a race game out of this, make a star shape with players at end points
  1873. and goal in middle.
  1874.  
  1875. "Medieval Diplomacy" a la Kingmaker
  1876.  
  1877. Each player is a lord/lady with coat of arms.
  1878. Few battles, much maneuvering.
  1879. More alliance machinery?
  1880. Need rules/state for varying degrees/types of alliance, could affect
  1881. mutual transport, control, temporary vs permanent gift, etc.
  1882. Can move armies around, raise/lower taxes, manage rebellions, wheel/deal.
  1883. Players have a chance of dying accidentally or of old age.
  1884. Can players be taken prisoner themselves and try to buy their freedom?
  1885. (Because if player is killed, possessions revert to neutral or to ally
  1886. rather than being acquired by capturer.)
  1887.  
  1888. (Need primitive for "exchange", theory is that actual individuals arranging
  1889. trade can prevent cheating on the spot, perhaps include a "chance of cheating
  1890. success" plus "attempt-to-cheat-p" that each player can set.)
  1891.  
  1892. (Be able to have "materials" like age or heat or poison that are deadly if you
  1893. accumulate too much? would need a excess-death-chance that is like starvation)
  1894.  
  1895. "Modern War"
  1896.  
  1897. Develop modern-day military games, both operational and strategic.
  1898.  
  1899. "Today"
  1900.  
  1901. An all-out simulation of the modern world at a 1/2 degree scale,
  1902. with each indep country as a side!  Use earth-50km map,
  1903. add cities and population to account for everybody.
  1904. Would need high-density cities, factories, etc.  Don't worry about size of
  1905. game, use it as a test of massive scale.
  1906.  
  1907. "Space Empires"
  1908.  
  1909. Like Spaceword HO or GB, based on thinly scattered solar systems with
  1910. planets as occupants, ships/cities occs of planets.  Deep space move
  1911. very slow (but not less than 1 hex/turn?), but could enter/leave gate
  1912. units more quickly if entry of non-adj unit allowed.
  1913. Solar systems are always-seen, but would need to explore planets more
  1914. carefully (planetary surfaces not plausible tho).
  1915. 1-month turns??
  1916.  
  1917. "Corporations"
  1918.  
  1919. [could make a game based on corporations that have units that are
  1920. factories etc, should be able to buy and sell them]
  1921.  
  1922. [most elaborate might be to allow corporations to coexist with
  1923. countries (what does that mean?)]
  1924.  
  1925. "Mars"
  1926.  
  1927. Settlement of Mars, a la the Kim Stanley Robinson book "Red Mars".
  1928. Build underground and domed cities, develop mining etc, try to
  1929. control as much of Mars as possible if multiple players.
  1930.  
  1931. --Misc
  1932.  
  1933. Add a "last-alliance-wins" scorekeeper, use with some games.
  1934.  
  1935. Add option to rotate layer data when saving.
  1936.  
  1937. Should be able to specify a rotation when saving a layer.
  1938.  
  1939. Decide when sides should be able to look at other units' hp.
  1940.  
  1941. Decide if/how country growth and initial strength should interact.
  1942.  
  1943. For small-part-of-world areas, define daylight-zone and twilight-zone(?),
  1944. which default to 1/2 and 1/12 respectively.
  1945.  
  1946. Be able to expand country borders by building or occupying outside original
  1947. country.
  1948. ut_add_people_chance n%
  1949. ut_add_people_adj_chance n%
  1950.  
  1951. To decide about revolt, define:
  1952. u_[indep_]revolt_chance .01n%
  1953. uu_[indep_]surrender-chance .01n%
  1954. uu_surrender_range n
  1955.  
  1956. Only certain types of units should be able to have mixed feelings, alloc
  1957. loyalty objects for these.  Loyalty objects all consistent size, needed only
  1958. if more than two feelings possible, else use 4-byte slot for values.
  1959. u_max_loyalties, default of 0 means like a machine, no issue of loyalty.
  1960. 1 means always loyal to overt side, but degree can vary.
  1961. 2 means overt and "true" side, be able to do with no extra space.
  1962. >2 possible, needs alloc.  Count indeps as one of sides.
  1963.  
  1964. Define a "process" object:
  1965. (process <name>
  1966.   (agents <unit-type(s)>)
  1967.   (automated-rate n1)
  1968.   (manual-rate n2) ; + acp to do?
  1969.   (inputs <material-types>)
  1970.   (outputs ...)
  1971.   (catalysts ...)
  1972.   (terrain-effects ...)
  1973.   )
  1974. Process agent units are optional.
  1975. May want to add "tooling" of units to do a process.
  1976.  
  1977. Restrict Lisp syntax knowledge to small part of code, allow translation
  1978. to other syntaxes (tcl?).
  1979.  
  1980. Implement delayed views, where a unit that is out of contact with the side
  1981. keeps own view data and only merges when in contact with side again.
  1982.  
  1983. Add a type of random event where a side or group of units can change
  1984. to an active side all at once, reflects changing politics, requires
  1985. maintenance of reserves, etc.
  1986.  
  1987. To do patrolling/picketing, space units so that few or no holes in coverage.
  1988. In theater being covered, check view dates and send units to update oldest
  1989. information - should be closest unit or one assigned to cover.  Could therefore
  1990. have a patrolling unit that only moves very little since its view range covers
  1991. nearly entire assigned area.  Allowable age of views depends on what sort of
  1992. surveillance is avail, how many units are assigned.
  1993.  
  1994. Derive acceptable risks from goals - unit that is crucial to game should not
  1995. risk self, disposable types can be sacrificed.
  1996.  
  1997. Construction calculations should prefer multi-purpose units, but randomize if
  1998. values close together.  (Test by making game variants with ultra-powerful
  1999. units, should see mplayer shift to building all the time.)
  2000. Each goal should be characterized timewise, so mplayer can start builds and
  2001. have units ready when goal becomes relevant.
  2002.  
  2003. Add a per-side flag that indicates if side is willing to have game saved;
  2004. voting is similar to that for quitting.
  2005.  
  2006. [vision-terrain-effect to alter range depending on terrain?]
  2007.  
  2008. [check validity of random event list after loading]
  2009.  
  2010. /* (eventually allow part of log to be kept on disk instead of in memory) */
  2011. /* (log file should be appended to, name should be tweakable) */
  2012. /* (log all relationship changes (need formal actions for these?)) */
  2013. /* (summarize some event types rather than recording each, need to designate
  2014.    duration of summarizing behavior) */
  2015. /* (a game design should be able to control size/complexity of log) */
  2016. /* (full data can go back <n> turns, then summarize data further back) */
  2017.  
  2018. /* (doctrine or general prefs specify what sorts of events get presented
  2019.    to players) */
  2020.  
  2021. Implement Massimo's proposal for morale and feelings:
  2022.  
  2023. @section Morale and feelings
  2024.  
  2025. @subsection Notes
  2026.  
  2027. [@code{feelings} and @code{morale} should be kept orthogonal to
  2028. @code{cxp} and acp-debt.]
  2029.  
  2030. @code{feelings} (towards each side) are ``affinities''; they can be used
  2031. to implement ``loyalty'', ``fear'', etc.
  2032.  
  2033. @code{morale} is a sort of ``self-feeling''; it can implement
  2034. ``heroism'', ``honor'', etc.
  2035.  
  2036. @code{feelings} and @code{morale} can also be used to model ``magic
  2037. spells'', ``bribes'', ``leadership'', etc.
  2038.  
  2039. [remove @code{attitudes-max}, have a feeling towards each side.]
  2040.  
  2041. [I think that the following ``status'', ``effects'', and ``charm'' parts
  2042. are reasonable; the ``change'' parts are very cumbersome, but I couldn't
  2043. come out with something better.]
  2044.  
  2045. @subsection Status
  2046.  
  2047. @deffn UnitProperty @code{feelings} side-value-list@dots{}
  2048. The unit's true feelings towards each side,
  2049. including its own side.
  2050. Defaults to @code{0} for each side.
  2051. @end deffn
  2052.  
  2053. @deffn UnitProperty @code{morale} fp
  2054. The unit's true morale.
  2055. Defaults to @code{0}.
  2056. @end deffn
  2057.  
  2058. @deffn UnitTypeProperty @code{feeling-max} fp
  2059. Sets the range for @code{feelings} and @code{morale} from
  2060. @code{-feeling-max} to @code{+feeling-max}. 
  2061. Defaults to @code{0}, which disables @code{feelings} and @code{morale}.
  2062. @end deffn
  2063.  
  2064. @subsection Morale effects
  2065.  
  2066. All the following modifier add to the given quantity; they are
  2067. proportional to @code{morale} and are given at @code{feeling-max}
  2068. (i.e., they are multiplied by @code{morale}/@code{feeling-max} first).
  2069. They all default to @code{0}.
  2070.  
  2071. @deffn Table @code{surrender-chance-morale-modifier} u1 u2 -> n%
  2072. [use for sieges?]
  2073. @end deffn
  2074.  
  2075. @deffn Table @code{base-production-modifier} u m -> n
  2076. @end deffn
  2077.  
  2078. @deffn UnitTypeProperty @code{acp-per-turn-modifier} acp
  2079. @end deffn
  2080.  
  2081. @deffn UnitTypeProperty @code{disband-chance-modifier} n%
  2082. @end deffn
  2083.  
  2084. @code{disband-chance-modifier} requires of course the introduction of
  2085. @deffn UnitTypeProperty @code{disband-chance} n%
  2086. This is the chance for the unit to disband spontaneously.
  2087. Defaults to @code{0}.
  2088. @end deffn
  2089. Example: setting @code{disband-chance} to @code{0} and
  2090. @code{disband-chance-modifier} negative can model samurais: when morale
  2091. becomes negative (their honor is spoiled), they have a chance of
  2092. disbanding (with @code{disband-message} @code{"commits seppuku"}).
  2093.  
  2094. @subsection Feelings effects
  2095.  
  2096. All the following modifier add to the given quantity; they are
  2097. proportional to @code{feelings} towards the ``other unit's side'' (which
  2098. may often be the ``unit's own side'') and are given at @code{feeling-max}.
  2099. They all default to @code{0}.
  2100.  
  2101. @deffn Table @code{surrender-chance-feeling-modifier} u1 u2 -> n
  2102. [use for sieges?]
  2103. @end deffn
  2104.  
  2105. @deffn Table @code{capture-chance-modifier} u1 u2 -> n
  2106. @end deffn
  2107.  
  2108. @deffn Table @code{withdraw-chance-modifier} u1 u2 -> n
  2109. @end deffn
  2110.  
  2111. @deffn Table @code{control-chance-modifier} u1 u2 -> n
  2112. @end deffn
  2113.  
  2114. @deffn UnitTypeProperty @code{revolt-chance-modifier} n%
  2115. (proportional to @code{feelings} towards the ``unit's own side'').
  2116. @end deffn
  2117.  
  2118. @subsection Morale at creation
  2119.  
  2120. Builders may ``transfer'' their morale/feelings to created units.
  2121.  
  2122.  
  2123. @deffn Table @code{creation-feelings} u1 u2 -> n
  2124. Newly created units start with @code{feelings} equal to n/100 of
  2125. creator's @code{feelings}. Defaults to @code{0}.
  2126. @end deffn
  2127.  
  2128. @deffn Table @code{creation-morale} u1 u2 -> n
  2129. Newly created units start with @code{morale} equal to n/100 of creator's
  2130. @code{morale}. Defaults to @code{0}.
  2131. @end deffn
  2132.  
  2133. @subsection Morale changes
  2134.  
  2135. They all add to the unit's @code{morale}.
  2136. They all default to @code{0}.
  2137.  
  2138. @deffn Table @code{terrain-morale} u t -> fp
  2139. fp is added after each turn to the @code{morale} of u sitting in t.
  2140. Models (dis)-comfort of unit in given terrain.
  2141. @end deffn
  2142.  
  2143. @deffn UnitTypeProperty @code{acp-low-point} acp
  2144. @end deffn
  2145. @deffn UnitTypeProperty @code{acp-low-morale} fp
  2146. @end deffn
  2147. @deffn UnitTypeProperty @code{acp-high-point} acp
  2148. @end deffn
  2149. @deffn UnitTypeProperty @code{acp-high-morale} fp 
  2150. If u is left with less then @code{acp-low-point} acp at the end of a
  2151. turn, @code{acp-low-morale} is added to its @code{morale}.
  2152. If u is left with more then @code{acp-high-point} acp at the end of a
  2153. turn, @code{acp-high-morale} is added to its @code{morale}.
  2154.  
  2155. They model fatigue/rest effects.
  2156. @end deffn
  2157.  
  2158. @deffn Table @code{mp-low-point} u m -> mp
  2159. @end deffn
  2160. @deffn Table @code{mp-low-morale} u m -> fp
  2161. @end deffn
  2162. @deffn Table @code{mp-high-point} u m -> mp
  2163. @end deffn
  2164. @deffn Table @code{mp-high-morale} u m -> fp 
  2165. If u is left with less then @code{mp-low-point} of m at the end of a
  2166. turn, @code{mp-low-morale} is added to its @code{morale}.
  2167. If u is left with more then @code{mp-high-point} of m at the end of a
  2168. turn, @code{mp-high-morale} is added to its @code{morale}.
  2169.  
  2170. They model starvation/abundance effects. [use for sieges? m is
  2171. @code{"food"}]
  2172. @end deffn
  2173.  
  2174. @subsection Feelings changes
  2175. They all add to the unit's @code{feelings} towards the ``other unit's
  2176. side''.  They all default to @code{0}.
  2177.  
  2178. @deffn Table @code{transport-feelings} u1 u2 -> fp
  2179. fp is added after each turn to the @code{feelings} of u1, enjoing the
  2180. ride or the vacation in u2 (which can be a ``resort hotel'').
  2181. @end deffn
  2182.  
  2183. @deffn Table @code{material-transfer-feelings} u m -> fp
  2184. fp is added (for each mp transferred) to the @code{feelings} towards the
  2185. side transferring the material m to u.
  2186. Models pay, bribes ... (m is often @code{"gold"}).
  2187. @end deffn
  2188.  
  2189. @subsection Morale and feelings changes
  2190.  
  2191. They add to the unit's @code{morale}, to @code{feelings} towards the
  2192. ``unit's own side'', or to  @code{feelings} towards the ``other unit's
  2193. side'', according to their keyword.  They all default to @code{0}.
  2194.  
  2195.  
  2196. @deffn Table @code{win-morale} u1 u2 -> fp
  2197. @end deffn
  2198. @deffn Table @code{win-own-feeling} u1 u2 -> fp
  2199. @end deffn
  2200. @deffn Table @code{win-other-feeling} u1 u2 -> fp
  2201. They are applied when u1 destroys u2.
  2202. @end deffn
  2203.  
  2204. @deffn Table @code{hit-morale} u1 u2 -> fp
  2205. @end deffn
  2206. @deffn Table @code{hit-own-feeling} u1 u2 -> fp
  2207. @end deffn
  2208. @deffn Table @code{hit-other-feeling} u1 u2 -> fp
  2209. They are applied when u1 hits u2.
  2210. @end deffn
  2211.  
  2212. @deffn Table @code{wound-morale} u1 u2 -> fp
  2213. @end deffn
  2214. @deffn Table @code{wound-own-feeling} u1 u2 -> fp
  2215. @end deffn
  2216. @deffn Table @code{wound-other-feeling} u1 u2 -> fp
  2217. They are applied when u1 is hit by u2.
  2218. @end deffn
  2219.  
  2220. @deffn Table @code{see-enemy-morale} u1 u2 -> fp
  2221. @end deffn
  2222. @deffn Table @code{see-enemy-own-feeling} u1 u2 -> fp
  2223. @end deffn
  2224. @deffn Table @code{see-enemy-other-feeling} u1 u2 -> fp
  2225. They are applied when u1 sees a hostile unit of type u2.
  2226. @end deffn
  2227.  
  2228. @deffn Table @code{see-friend-morale} u1 u2 -> fp
  2229. @end deffn
  2230. @deffn Table @code{see-friend-own-feeling} u1 u2 -> fp
  2231. @end deffn
  2232. @deffn Table @code{see-friend-other-feeling} u1 u2 -> fp
  2233. They are applied when u1 sees a friendly unit of type u2.
  2234.  
  2235. @code{see-enemy} and @code{see-friend} can be used to implement
  2236. specialized morale/feeling (anti-)boosters: secret police, preachers,
  2237. leaders, dragons, nazguls...
  2238. @end deffn
  2239.  
  2240. @deffn Table @code{capture-morale} u1 u2 -> fp
  2241. @end deffn
  2242. @deffn Table @code{capture-own-feeling} u1 u2 -> fp
  2243. @end deffn
  2244. @deffn Table @code{capture-other-feeling} u1 u2 -> fp
  2245. They are applied when u1 is captured by u2.
  2246. @end deffn
  2247.  
  2248. @deffn UnitTypeProperty @code{change-side-morale} fp
  2249. @end deffn
  2250. @deffn UnitTypeProperty @code{change-side-own-feeling} fp 
  2251. @end deffn
  2252. @deffn UnitTypeProperty @code{change-side-other-feeling} fp
  2253. They are applied when u changes side (own is the ``old'' side, ``other''
  2254. the new side).
  2255. @end deffn
  2256.  
  2257. @deffn UnitTypeProperty @code{revolt-morale} fp
  2258. @end deffn
  2259. @deffn UnitTypeProperty @code{revolt-own-feeling} fp 
  2260. They are applied when u revolts.
  2261. @end deffn
  2262.  
  2263. @subsection Charm
  2264.  
  2265. This action can model magic spells, terrorism, psychological weapons,
  2266. propaganda, bribes, etc.
  2267.  
  2268. @deffn ActionType @code{charm} unit
  2269. This is the action that a unit performs to modify the @code{morale} and
  2270. @code{feelings} of another unit.  The unit must be visible and within
  2271. @code{charm-range} to be charmed. 
  2272. @end deffn
  2273.  
  2274. @deffn UnitTypeProperty @code{charm-range} dist 
  2275. Defaults to @code{1}.
  2276. @end deffn
  2277.  
  2278. @deffn Table @code{charm-friend-chance} u1 u2 -> n% 
  2279. The chance of charming a friendly unit.
  2280. Defaults to @code{0}.
  2281. @end deffn
  2282. @deffn Table @code{charm-enemy-chance} u1 u2 -> n%
  2283. The chance of charming a hostile unit.
  2284. Defaults to @code{0}.
  2285. @end deffn
  2286.  
  2287. @deffn Table @code{acp-to-charm} u1 u2 -> acp
  2288. This is the number of acp a unit uses to do one charm action.
  2289. Defaults to @code{1}.
  2290. @end deffn
  2291. @deffn Table @code{charm-consumption} u1 m -> mp
  2292. This is the amount
  2293. of u1's supply used up in one charm action.
  2294. m is usually something like @code{"mana"} or @code{"gold"}.
  2295. Defaults to @code{0}.
  2296. @end deffn
  2297.  
  2298. @deffn Table @code{charm-morale} u1 u2 -> fp
  2299. Added to u2's @code{morale} if charm is successful.
  2300. Defaults to @code{0}.
  2301. @end deffn
  2302. @deffn Table @code{charm-own-feeling} u1 u2 -> fp
  2303. Added to u2's @code{feelings} towards its side if charm is successful.
  2304. Defaults to @code{0}.
  2305. @end deffn
  2306. @deffn Table @code{charm-other-feeling} u1 u2 -> fp
  2307. Added to u2's @code{feelings} towards u1's side if charm is successful.
  2308. Defaults to @code{0}.
  2309. @end deffn
  2310.  
  2311. @subsection Relaxation
  2312.  
  2313. @deffn UnitTypeProperty @code{morale-relaxation} n
  2314. @end deffn
  2315. @deffn UnitTypeProperty @code{own-feelings-relaxation} n
  2316. (for the unit's own side)
  2317. @end deffn
  2318. @deffn UnitTypeProperty @code{other-feelings-relaxation} n 
  2319. (for all the other sides)
  2320.  
  2321. They default to @code{100}.
  2322. @end deffn
  2323.  
  2324. At the and of each turn, the old values of @code{feelings} and
  2325. @code{morale} are multiplied by (the appropriate) n/100; then all the
  2326. previous modifiers are added; the result is rounded to an integer in the
  2327. usual (stochastic) way to obtain the new @code{feelings} and
  2328. @code{morale}.
  2329.  
  2330. @subsection Missing
  2331.  
  2332. @code{revolt-chance} modifier for occupants (and nearby units).  Then,
  2333. using with @code{revolt-chance-modifier} and assuming that a
  2334. newly-captured unit retains a ``bad'' feeling towards the old enemy, you
  2335. will have to guard a newly-captured unit (with your ``secret police''?)
  2336. until its feeling towards you improves.
  2337.  
  2338. Effects of side behavior: d.o.w. or breaking a treatise should modify
  2339. feelings of (certain) units.
  2340.  
  2341. Effects of weather.
  2342. (end of proposal)
  2343.  
  2344. --X11 Interface
  2345.  
  2346. SelFile should be configured in with with-selfile, only built
  2347. and linked in if configured and present.  Fix nonportabilities
  2348. like decl of sys_errlist, etc.
  2349.  
  2350. Colorize unit icons via u_color().
  2351. Allow either use of side colors (symbolically, %1, %2, etc
  2352. matching against side color array elts, or by name).
  2353.  
  2354. List of unit types should gray out types that can't be owned by
  2355. the player.  Add option to eliminate any that can't be in game
  2356. at all (designer will need to see all types though).
  2357.  
  2358. Players should be able to indicate a willingness to declare a draw.
  2359. should display other sides' willingness to draw.
  2360.  
  2361. Use special bg pattern or stipple for unseen and grid colors if mono.
  2362. (or - support {lt,md,dk}gray on mono displays, in addition to other patterns.
  2363.  
  2364. Let imf2x only extract bitmaps whose names match given arg.
  2365.  
  2366. Add resource name to request_color, use to override standard
  2367. color choices.
  2368.  
  2369. Add resources:
  2370.     -xrm
  2371.     -display (for player starting the game)
  2372.     -fn, -font (text font only)
  2373.  
  2374. Use Xconq.game.<game>.<unit>.{char,image,color} to set per-game colors etc.
  2375.  
  2376. Use Xconq.{map,worldmap}.draw{Terrain,Grid,Style,Units,People,...}
  2377. to set appearance of new maps.
  2378.  
  2379. Add side->ui->default_drawunits etc to set initial values for each
  2380. created map, let these be settable from resources.
  2381.  
  2382. Fix drawing to not damage borders or else redraw as needed.
  2383. What rules for which should lay on top of which?
  2384. Try to optimize so border redrawing not always being done.
  2385.  
  2386. Default unit images should include first few chars of name in box,
  2387. a la Mac interface.
  2388.  
  2389. Allow setting of window subdivisions via resources.
  2390. Xconq.map.listWidth: <pixels>
  2391. Xconq.map.notesHeight: <lines>
  2392.  
  2393. Add good features of 5.5.
  2394.  
  2395. Develop a higher-contrast more-visible display of current unit/location.
  2396.  
  2397. Typing text into ask_position switches to prompt, reads a textual spec
  2398. of location.
  2399.  
  2400. Allow terrain color to be two colors, use to colorize mono bitmap
  2401. for terrain.
  2402. Search for ',' in t_color, fg first, then bg, assume bg is black if
  2403. not given.  Need a way to reverse so fg is black and bg colored.
  2404.  
  2405. imf2x should indicate progress, never overwrite existing images
  2406. (or compare - effectively "move-if-change" behavior)
  2407.  
  2408. Use a builtin color matching a color name if possible, otherwise
  2409. use the imc definition.
  2410.  
  2411. Write image scalers for *2 and /2 size images, compute and cache during
  2412. startup.  Shrink rule is 0,1 -> 0, 2,3,4 -> 1.
  2413.  
  2414. Main game help should include lists of types and their most important
  2415. properties.
  2416.  
  2417. To describe movement abilities, display both acp and "move range over
  2418. a given terrain type", which may be much less.
  2419.  
  2420. Non-tiling terrain patterns should be centered in cell on top of another
  2421. pattern/color possibly.  How to scale to larger cells?
  2422.  
  2423. Lists of units should also be able to display glimpses, just omit data
  2424. that is not available (what about names? might be tough to save names
  2425. with glimpses)
  2426.  
  2427. A hex consists of the hex and a unit display area entirely inside.
  2428. Only magnify unit images up to a point, not always to fill hex
  2429. (should make proportional to stack capacity).
  2430.  
  2431. Never try to auto-calculate hex chars from fill patterns,
  2432. but maybe provide a simple tool, goes with tool to build
  2433. font from bitmaps?
  2434.  
  2435. Font should support terrain pattern inside colored hex - needs to be
  2436. precomputed when building the font.  If not avail, still have to draw
  2437. twice.
  2438.  
  2439. If names displayed on map, use different size (and type?) fonts
  2440. for different kinds of units.
  2441. Legend fonts should vary with magnification also.
  2442.  
  2443. Decide who will see terrain changes in general, and weather/season
  2444. effects.  Need always-seen for these things, use coverage arrays as well.
  2445. Also allow for varying reliability and completeness of this.
  2446.  
  2447. What to do about area painting and dragging?  Turn on pointer motion
  2448. events temporarily?  Look at "bitmap" source.
  2449.  
  2450. Make the font stuff work again.
  2451. Define a family of "xconq" fonts, one (or two?) for each size, pack in
  2452. icons, masks, terrain.  Eventually allow more than one font at each size,
  2453. in case too many images.  Concentrate on terrain at first...  Keep separate
  2454. file with char->image mapping, read in from a standard place at startup.
  2455. (Install in program? No, can't update when font is updated)
  2456.  
  2457. For event list display, maintain buffer of n lines, each pointing to
  2458. event being listed, recalc when window enlarged, etc.
  2459. When list[i] selected, display event description plus ptrs
  2460. to related events.
  2461. Some "events" will be summaries (like total losses),
  2462. be able to change amt of summarization.
  2463. Observer mask is parenthetical remark.
  2464. Include toggles to display events as they come in, and
  2465. to scroll map to show where event is happening.
  2466.  
  2467. Change setup to use a single popup; list of games and preview at top,
  2468. then variants (min size initially, then grow for actual variants),
  2469. then player list and buttons.
  2470. Use cmdline to fill in as much as possible.
  2471. Highlight stage as committed to.
  2472. Confirm openability of each display when typed in.
  2473. Xconq.setup:
  2474. Xconq.setup.game:
  2475. Xconq.setup.game.list:
  2476. Xconq.setup.game.description:
  2477. Xconq.setup.game.picture:
  2478. Xconq.setup.game.loadbutton:
  2479. Xconq.setup.variants:
  2480. Xconq.setup.variants.{things}:
  2481. Xconq.setup.variants.ok:
  2482. Xconq.setup.variants.cancel:
  2483. Xconq.setup.players:
  2484. Xconq.setup.players.list:
  2485. Xconq.setup.players.{aibutton,etc}:
  2486. Xconq.setup.ok:
  2487. Xconq.setup.cancel:
  2488.  
  2489. Dynamically allocate more of the ui struct of each side.
  2490.  
  2491. --Macintosh Interface
  2492.  
  2493. Add explicit test for cicn 256, warn if one exists.
  2494.  
  2495. Fix to beep if a unit ordered to attack but has no ammo available.
  2496. Should also pop up or otherwise make a warning visible.
  2497.  
  2498. Fix scrolling confusions in history window.
  2499.  
  2500. Fix scrolling confusions in list window.
  2501.  
  2502. Add option to display terrain as solid colors if colors are available.
  2503.  
  2504. Don't require resignation if quitting while a designer.
  2505.  
  2506. Define and use an "erase-in-the-grid" procedure.
  2507.  
  2508. Build Mac docs from combined Mac-specific and generic player info.
  2509.  
  2510. Add a "completed units only" option to list view.
  2511.  
  2512. Display GPL somewhere at startup.
  2513.  
  2514. Don't force update or redraw of windows if clicking a button has no
  2515. visible effect (wrong mag for instance).
  2516.  
  2517. Don't redraw unchanged scores.
  2518.  
  2519. Ensure that "computer" and "face" icons updated when side info changes.
  2520.  
  2521. Interp arg to 'P' as number to build, seed from doctrine.
  2522. 'P' should bring up modal dialog?
  2523.  
  2524. In IMFApp, separate "color/mono" from "cqd available" display options.
  2525.  
  2526. In IMFApp, "Open..." should preselect imf.dir if exists.
  2527.  
  2528. In list, add column that indicates current task.
  2529.  
  2530. Disable "give" menu entirely if giving not allowed.
  2531.  
  2532. Attach version resources to all components of Mac binary distribution.
  2533. Do with MPW script that recurses through all files.
  2534.  
  2535. Change of map magnification should automatically set window to user state.
  2536.  
  2537. Add machinery to display/write out final statistics.
  2538. (Use standard name "stats.xcq".)
  2539. Choice to write should be preference, or else ask when game is over.
  2540.  
  2541. Display range of possible advantages in player dialog, allow setting via
  2542. popup or text box as well as up/down arrow.
  2543.  
  2544. Add numerical display option for sides, set up 8x8 or 6x8 number emblems.
  2545. Also allow larger sizes of numerals (12x12 or 9x12).
  2546.  
  2547. Save sound on/off state as part of "ui-data" save, plus save window info,
  2548. flagged as Mac-specific, so can play under X for awhile, drag back to Mac
  2549. and get same setup, drag to X again and get X setup again.
  2550.  
  2551. Eliminate occasional need to click a second time to get a build to happen.
  2552. (Probably because unit hasn't come up in execution order yet.)
  2553.  
  2554. Add rubberbanding to world shape/size dialog.
  2555.  
  2556. Don't redraw all controls when updating designer dialog.
  2557.  
  2558. Support large numbers of sides in setup by adding a scroll bar between list of
  2559. sides and the buttons.
  2560.  
  2561. Draw side progress bars incrementally when possible.
  2562.  
  2563. Describe not-yet-arrived units correctly in list windows.
  2564.  
  2565. Check for events between every few rows of drawing, be able to abort or restart
  2566. drawing if requested.
  2567.  
  2568. Make designer palette into a floating window.
  2569.  
  2570. Do mouse-based actions when mouse *released*.
  2571.  
  2572. Use unit->uihook to optimize re-selection of units in maps.
  2573.  
  2574. Clicking in construction should cause next window back to scroll/hilite
  2575. selected unit (or add a button to do?)
  2576.  
  2577. Use drag of unit to indicate waypoints of a path, feedback with envelopes
  2578. of route and only do waypoints when indicating points outside shortest route.
  2579.  
  2580. Be able to double-click in build dialog to set construction .
  2581.  
  2582. When laying out list window, precompute widths of columns using max/expected
  2583. string widths for type names etc.  Account for width of headers and desired
  2584. spacing between columns.
  2585.  
  2586. Make pdoc load game and print the full description of it.
  2587.  
  2588. Allow multiple units to be selected in list windows.
  2589.  
  2590. Express merge by dragging onto unit, express detach by supplying an amount
  2591. in modal dialog (awkward, but rare?)
  2592.  
  2593. Should be able to zoom or resize side list to show relative standings and
  2594. other detail about each side.
  2595.  
  2596. Allow for more flexibility in size of emblem relative to unit (a preference?)
  2597.  
  2598. Display instructions and notes from multiple modules possibly, need to say
  2599. how to do this (explicit "append" directive at end of instructions?).
  2600.  
  2601. Implement a progress bar for internals of AI calcs or at least a watch cursor.
  2602.  
  2603. Extend construction dialog to include material production.
  2604.  
  2605. Build routines to insert a string into a "field" of a list entry,
  2606. instead of rebuilding entire entry.
  2607.  
  2608. Mark menus to indicate whether any of a group of selected units matches
  2609. each item.
  2610.  
  2611. Unhighlight forward/backward arrows when no units to look at.
  2612.  
  2613. Command-. should be able to interrupt nearly any calculation.
  2614.  
  2615. Preferences dialog should have a list of specific setups to choose from
  2616. ("big screen", "careful play", etc) impl as config-names.  Player config
  2617. objects should include Mac-specific flags then...  Dialog can also have
  2618. several screens of options.
  2619.  
  2620. To display names, make a layer of shorts where each value is location of
  2621. cell with the legended object.  Cell itself has access to legend, plus
  2622. flag indicating direction and position of beginning of legend.  Then to
  2623. erase legend, have to clear each cell that refers to given cell.
  2624. Also need to repair legend correctly when another unit passes through it.
  2625.  
  2626. When drawing rubberband line for movement, make line heavier for part of
  2627. movement that will happen immediately.
  2628.  
  2629. World is totally lit if dimensions < half of world circumference and all
  2630. six corners of hexagon have same lighting.  If world totally dark, draw
  2631. darkening mask only.
  2632.  
  2633. When listing units by location, add twist-down for occupants, group stack
  2634. members with bar or some such.
  2635.  
  2636. Be able to draw more unit info on map window, at least at high mag powers.
  2637. Do num parts/hp, mp/acp, in misc corners a la Empire Master.  Unit id would
  2638. be useful also sometimes.
  2639.  
  2640. Implement both randomly-chosen and cycling image sets for the map window.
  2641.  
  2642. Support multiple sounds - ones for attack, hit, death, use diff ones
  2643. for shooting, possibly movement noises.
  2644. Should be able to define special win/lose sounds (cheers and raspberries),
  2645. attach to interface's handling of events from kernel.
  2646.  
  2647. Implement images and sound effects for combat (at different scales, so
  2648. need to incorporate into imf machinery).
  2649.  
  2650. To indicate available movement, change cursor to reflect accessibility
  2651. and amount of time needed to get there (ETA) or display in control panel
  2652. or elsewhere on map.
  2653.  
  2654. Implement doctrine as dialogs examining doctrine objects.
  2655. Add button in unit closeups.
  2656.  
  2657. Do offscreen drawing for visible map plus part of area around, but need
  2658. to calc memory limits so as not to exhaust space prematurely.  Do one
  2659. offscreen area/map, precalc size and retain, use individual cell drawing
  2660. otherwise.
  2661.  
  2662. To draw maps while still allowing events, make an array of rows for each map.
  2663. Update event computes which rows to redraw, plus start/end of each (use 0/0
  2664. to indicate no drawing needed).   Then in main event-handling loop, if rows
  2665. remain to be drawn, do one or a few ("draw rows for 15 ticks") then go back
  2666. to wait for event.  Only call run_game when a) all map rows are drawn, or
  2667. b) an event comes in from another machine.
  2668.  
  2669. Be able to hit key to bring up useful data while rubberbanding, or else have
  2670. additional popup with this info.
  2671.  
  2672. Add localizations for common languages.
  2673.  
  2674. Support distinct images for individual units, via a hook property.
  2675. Maintain id->image table (hash table? do sizes as well).
  2676.  
  2677. Add a graph window that displays up to 4-5 chosen statistics against time.
  2678. Needs choice of what to display and a subset selector for each graph.
  2679. Some stats will have records that have been kept, others will start only
  2680. when graph is requested, but then keep accumulating even if no longer
  2681. being displayed.
  2682.  
  2683. For Gettysburg, add movie showing rain descending on field at end of game.
  2684.  
  2685. Finish perspective display handling.
  2686.  
  2687. Add machinery (to MPW version) to build an integrated executable that
  2688. doesn't need lib or lib-mac.  Use sed/streamedit and Rez to make
  2689. resources from text files, plus renumber so no conflicts with
  2690. base resources.
  2691.  
  2692. --Windows Interface
  2693.  
  2694. Add one.
  2695.  
  2696. --NextStep Interface
  2697.  
  2698. Add one.
  2699.  
  2700. --Curses Interface
  2701.  
  2702. To describe movement abilities, display both mp and "move range over
  2703. a given terrain type", which may be much less.
  2704.  
  2705. When moving cursor modally, maintain some info about what exactly is under
  2706. the cursor (use whole info space, put info about what is being
  2707. moved in mode line).
  2708. Include info about distance from starting position, and support "direction"
  2709. cmds to cycle through stack.
  2710. Distinguish perm from temp top line data, keep track of each separately.
  2711.  
  2712. 'D' doctrine, have it bring up textual summary, use textual commands to
  2713. modify.
  2714.  
  2715. To tweak display, use "[+-][utn]" to enable/disable units, terrain, names.
  2716.  
  2717. For event list display, maintain buffer of n lines, each pointing to
  2718. event being listed, recalc when window enlarged, etc.
  2719. When list[i] selected, display event description plus ptrs
  2720. to related events.
  2721. Some "events" will be summaries (like total losses),
  2722. be able to change amt of summarization.
  2723. Observer mask is parenthetical remark.
  2724. Include toggles to display events as they come in, and
  2725. to scroll map to show where event is happening.
  2726.  
  2727. Allow putting up a legend to display chars (such as terrain type chars)
  2728. in list area.  Bring up via '/' or perhaps option to general help.
  2729.  
  2730. If can support, add getch() timeout so human can move immediately instead
  2731. of waiting for mplayer to finish.  Indicate that mplayer is "thinking"
  2732. periodically, need kernel callback (?).
  2733.  
  2734. Add printing - just dump into something lpr'able.
  2735.  
  2736. Help topics should be formatted as multi-column list, let arrow keys
  2737. move around.
  2738.  
  2739. If a savefile is present and no contradictory args found (no -f, -g, -join),
  2740. ask the player if they wish to resume the saved game.
  2741.  
  2742. Ensure that all stdout/stderr stuff goes into a file so screen doesn't
  2743. get scrambled, even with debugging on. (copy Mac code)
  2744.  
  2745. Warnings should have a preference to record full text of warning in a file.
  2746. Full warning should more data at end of message, then truncate if too big
  2747. for alerts.  (If warning recording is on, mention in alerts or somewhere
  2748. that additional data is available in a given file.)
  2749.  
  2750. --DOS/VGA Interface
  2751.  
  2752. Add one.  (Xconq is fundamentally 32-bit code, so not much point in
  2753. trying to do anything less than i386 with VGA; in other words, use
  2754. DJGPP with libgrx.)
  2755.  
  2756.  
  2757.